I’ve found today that if assigni .day .month and .year to a Date instance returns a wrong day if date.day > 28 (Web App. compiled for Linux Works fine).
If i do (This is on 2013r4.1 on a Mac Running 10.9.1)
Dim TheDate as new Date
TheDate.Day=31
TheDate.Month=1
TheDate.Year=2014
TheDate.SQLDate returns “2014-01-03”
If you do the same with TheDate.Day=30, then TheDate.SQLDate returns “2014-01-02”
For TheDate.Day=29, then TheDate.SQLDate returns “2014-01-01”
And finally for TheDate.Day<=28, then TheDate.SQLDate returns the correct date.
As i told i detected this debugging a Web App on Mac, the compiled version for Linux works fine.
Tried the same with a desktop app and the same happens. The compiled desktop (Mac) app ALSO FAILS!.
Is this some known? I’ve been unable to find something about this in feedback.
It’s one of those peculiarities with Dates. TheDate starts as today 03/02/2014. Setting the day to 31 makes this 3/3/2014, setting the month makes this 3/1/2014. Just always set the Year then Month then Day & you’ll be fine.
This is one of those glitches that seems to come and go. The Date is supposed to be like Schroedinger’s Cat, where it doesn’t resolve until you look at it. In other words, the order you set the values isn’t supposed to matter. But it does. Sometimes.