samedi 24 juin 2017

PHP- Carbon Datetime DiffInSeconds and How to Group By Hour

I'm calculating difference between 2 datetimes in seconds but I want to group them by hours. It should be like that.

This is how I'm getting difference between 2 dates.

$date_diff = $first->created_at->diffInSeconds($second->created_at);

And For example first time is 09:47:20 and next one is 11:47:50 I need the group them by hour like this.

In 09:00 =  13.40 Minutes
In 10:00 =  60.00 Minutes
In 11:00 =  47.50 Minutes

How can I do that ? And what you'll suggest for this ?

Thanks



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2tFtLdv
via IFTTT

Aucun commentaire:

Enregistrer un commentaire