So, I studied a lot about day and time maths with some great explanations here in the forum but, after some hours of trying I still don’t found a solution for this:
Any idea how can I get the current daytime, add 60min (one hour), and ROUND it to the next 30 minutes?
Here some examples: 10:23 become 11:30 (one more hour and next rounded half hour) 10:37 become noon (again, one more hour and next round half-hour)
It’s for a create schedule page, where I want to show options that start with a minimum of one hour from now, the options will have 30 minutes between them.
I know how to create the list of options and everything else is working fine, but I need to make this time math. Can someone help me with it? Thanks!
set “resulting time”: add 1hr29 to the current time (add 1/24/60*89)
– there is no “RoundUP” function in Adalo, so I think adding 1hr 29 mins and rounding it down should work: 10:30 + 1:29 = 11:59 → 11:30; 10:23 + 1:29 = 11:42 → 11:30; 10:31 + 1:29 = 12:00 → 12:00.
get the integer & fractional part of the resulting time
multiple fractional part by 48
– we’ll get “half-hours” as integers here
take INT out of the fractional part
divide the result by 48
– back to “part of the day”
add this result to the integer part of the resulting time (from step 2)
I didn’t try it in the app - this is pure theory. Will check later if it works