Date confusion

Get help using and writing Nisus Writer Pro macros.
Post Reply
User avatar
loulesko
Posts: 124
Joined: 2008-01-20 11:08:35
Location: California
Contact:

Date confusion

Post 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
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Date confusion

Post 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.
philip
User avatar
loulesko
Posts: 124
Joined: 2008-01-20 11:08:35
Location: California
Contact:

Re: Date confusion

Post by loulesko »

Phillip

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

Lou
Post Reply