I am using a time widget i need to set the time on load to nearest quarter hour. for example if current time 10:43, i need to set to 10:40 or even 10:45. How do we do this in outsystems.
prashanth ms,
Let's say your old datetime value is in OldTime variable.
New time rounded to nearest quater can be calculated the following way:
NewMinute = Round(Minute(OldTime)/15) * 15;
NewTime(Mod(Hour(OldTime) + Trunc(NewMinute/60), 24), Mod(NewMinute, 60))
Vitaly Martynenko wrote:
thanks for this quick work around logic.
Hello prashanth,
I don't think there is anything "ready" for this.
But you could use the Minute builtin action to retrieve the "minute part", round it using logic and then build the time again using the NewTime builtin action.
Cheers.
Eduardo Jauch wrote:
thanks.