Next o'clock hour

J_jvs
Participant V

Hi Team,
would be possible to use in an “initial value” of time
next time o’clock() ?

ex:
if timenow() = 14:25
then next time o’clock = 15:00

thanks in advance and happy christmas days for all appsheeters.

Solved Solved
2 5 348
1 ACCEPTED SOLUTION

Steve
Participant V

Try:

("00:00:00" + HOUR(TIMENOW() - "00:00:00") + 1)

View solution in original post

5 REPLIES 5

Steve
Participant V

Try:

("00:00:00" + HOUR(TIMENOW() - "00:00:00") + 1)

thks a lot Steve!!!

Bahbus
Participant V

Hmm, CEILING wouldn’t work for time formats, eh? I should probably make a feature request that math functions like ROUND, CEILING, FLOOR, etc to be useable on TIME data types.

Just for purely academic purpose, thought of sharing another variation of the expression. The expression is totally inspired by and based on @Steve’s original excellent expression.

Dave also rightly suggested the use case of CEILING, FLOOR, ROUND etc. for direct use on Time data types, which will make Time math much easier. The expression below incidentally needs and indirectly uses CEILING and thus justifies Dave’s suggestion.

“00:00:00”+CEILING(TOTALHOURS(TIMENOW() - “00:00:00”))

Bahbus
Participant V

Yes, and my upcoming feature request will be to use them directly. Since [Time]+[Number] math works, and converts Number to be in hours by default. My feature request is basically that ROUND/CEILING/FLOOR([Time]) should automatically do their things to the nearest hour.

Also, in my opinion, TIME and DECIMAL should be compatible & convertible on the backend. TIME(5.5) should equal 05:30 or 5:30AM and DECIMAL(“05:30”) should equal 5.5. Because this change would because fix my top request by default and wouldn’t require a change to how those functions…uh…function.

Top Labels in this Space