Page 1 of 1

Date confusion

Posted: 2023-09-25 11:51:55
by loulesko
Hi there,

Am using the following in a macro:

Code: Select all

$hour = Date.now.hour12
It returns 0 when it's the noon hour. Which is odd because the macro reference says The hour on the 12 hour clock, 1-12 inclusive.

Code: Select all

$hour = Date.now.hour
Returns 12 as expected

Thanks
Lou

Re: Date confusion

Posted: 2023-09-25 15:52:01
by phspaelti
Methinks the "inclusive" is misleading. ".hour12" returns a value in the range 0-11, which frankly is the desired behavior.
".hour" will return a value in the 0-23 range, so 12PM will return 12 while 12AM will return 0.

Re: Date confusion

Posted: 2023-09-26 08:30:21
by loulesko
Phillip

Now I get get, it thanks. Always good to hear from you.

Lou