question

Mischa Spelt avatar image
0 Likes"
Mischa Spelt asked Phil BoBo edited

Where is DateTime.month?

I like the new DateTime class, it has useful properties like .day, .dayOfWeek and .year. But where is .month? I am guessing this is an oversight?

While you fix this, is there an easy way to get the month from a given model time stamp?

Also, how do I most easily construct a DateTime when I have all the parts (year, month, day, hour, ..) separately?

(PS The Sign in and post button forgot my post after signing in.)

Choose One
bug reportdate
· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

The month property will be in the next bug fix release.

1 Like 1 ·
Ben Wilson avatar image Ben Wilson ♦♦ commented ·

@Mischa Spelt, thanks for the notification regarding the "Sign In and Post" button. Testing now...

0 Likes 0 ·
Ben Wilson avatar image Ben Wilson ♦♦ Ben Wilson ♦♦ commented ·

Couldn't duplicate. Worked fine for me testing on Chrome. Can you provide any other details? Were you on the ask.html page for a long time before submitting? Were there any missing fields when you submitted? Thx.

0 Likes 0 ·

1 Answer

·
Phil BoBo avatar image
3 Likes"
Phil BoBo answered Phil BoBo edited

17.2.2 should be available sometime next week with the DateTime.month property available.

Currently, 17.2.1 also has a bug in the DateTime.toString() method where the month is off by 1 and crashes in December, so using that as a workaround is also not possible until 17.2.2 when that bug is also fixed.

There is not currently a way to easily construct a DateTime from individual parts. Adding this functionality is on the dev list.

On a related note, DateTime.fromExcelTime() was also not working correctly in 17.2.1 and has been fixed for 17.2.2.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.