vendredi 28 juillet 2023

Writing Laravel code for the find total duration using data

I am facing one problem for finding total duration in Laravel 9. I tried many methods but it not getting correct hours and mins. Here is the data:

"Arrival_DateTime": "08/28/2023 21:50",
"Departure_DateTime": "08/28/2023 20:00",
"Arrival_DateTime1": "08/29/2023 03:10",
"Departure_DateTime1": "08/29/2023 02:00",

Output want below hours and mins

"duration": "8 h 40 m","layover": "4 hr 10m"

also if same calculation add tow more timing also please suggest me the code.

I tried using strtotime and total calculate but it

Output want below hours and mins

"duration": "8 h 40 m","layover": "4 hr 10m"


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire