Hi,
I have a data set on the hours worked "starting time" and "end time" in 24 hrs format. I need to calculate the duration as the number of hours worked.
time_t time_fr
04:00 06:00
06:00 06:30
06:00 06:30
21:30 04:00
i applied the date format ("DMY hms") and brought the same into the following format
time_from time_to
01jan1960 06:00:00 01jan1960 04:00:00
01jan1960 06:30:00 01jan1960 06:00:00
01jan1960 06:30:00 01jan1960 06:00:00
01jan1960 04:00:00 01jan1960 21:30:00
However, in those cases (4th row) where the hours worked extended to the next day, I get the wrong figure (highlighted in bold).how can I fix this?
appreciate your help.
Thanks in advance.
I have a data set on the hours worked "starting time" and "end time" in 24 hrs format. I need to calculate the duration as the number of hours worked.
time_t time_fr
04:00 06:00
06:00 06:30
06:00 06:30
21:30 04:00
i applied the date format ("DMY hms") and brought the same into the following format
time_from time_to
01jan1960 06:00:00 01jan1960 04:00:00
01jan1960 06:30:00 01jan1960 06:00:00
01jan1960 06:30:00 01jan1960 06:00:00
01jan1960 04:00:00 01jan1960 21:30:00
However, in those cases (4th row) where the hours worked extended to the next day, I get the wrong figure (highlighted in bold).how can I fix this?
appreciate your help.
Thanks in advance.
Comment