This content has been marked as final. Show 3 replies
I would like to round time this way :
|From original timestamp||Half hour||Quarter||Time by 5 minutes steps|
Rounded values should never be superior to originale timestamp.
So possible values can be :
* Half hour -> 21:00, 21:30, 22:00, 22:30 ...
* Quarter -> 21:00, 21:15, 21:30, 21:45 ...
* Time by 5 minute step -> : 21:00, 21:05, 21:10, 21:15 ...
I created a master calender this way (Field "Horodatage" is a timestamp) :
Horodatage, // Original timestamp
MakeDate(Year(Horodatage), Month(Horodatage), Day(Horodatage)) as Date,
Num(Hour(Horodatage), '00') & 'h' as Hour,
Time(Class(Time(Horodatage),0.5/24), 'hh:mm') as Half_Hour,
Time(Class(Time(Horodatage),0.5/2/24),'hh:mm') as Quarter,
Time(Class(Time(Horodatage),0.5/6/24),'hh:mm') as Time_By_5
But i recently noticed that sometimes rounding is correct and sometimes not (yellow):
Do you have an idea why it doesn't work here? Do you have a better calculation method ?
Thank you by advance !