A customer of mine noticed a weird date issue.
The birthdates were one day off (like 29th was 28th) on a list they use.
Turns out that on that list I use a label with the field as a tag.
When I put that same field as normal text_field on that form (no formatting applied) it shows correctly.
Using a label with the field as dataprovider shows the date also correctly.
The column is a DATE type in the (PostgreSQL) database.
Anyone else seeing this?
Servoy Developer
Version R2 2.2.5-build 337
Java version 1.5.0_06-64 (Mac OS X)
Ooookay, this one is even weirder then expected but a bug nevertheless.
When you have a database field (date/datetime) and you use this in a label as a tag then when you show a date that ranges from 1-1-xx50 to 1-2-xx70 (any century before 2000) then it looses a day.
So:
1-1-1950 becomes 31-12-1949
1-1-1655 becomes 31-12-1654
etc.
When using a date from a global field everything works fine.
Servoy Developer
Version R2 2.2.5-build 337
Java version 1.5.0_06-64 (Mac OS X)
Bug filled in bugbase (case: 43438 ) with example solution.
Yes, I have experienced this ‘one day off’ issue as well. In my case it was with insurance policy renewal dates. Fortunately, they were showing one day early and not one day late!
Did you sort this out? It’s my understanding (= quite possibly wrong) that dates are always stored as milliseconds since midnight 01 January, 1970
UTC.
With the timezone set to Australia/Victoria (= UTC + 10), before 10am today,
application.getTimeStamp() returns 10 while
application.getTimeStamp().getDate() returns 9.
After 10am they both return 10.
I guess this is the expected behaviour, but I wasn’t expecting it and it caused some problems for me converting dates to strings (eg 10072006 ) before I allowed for the difference.
One problem I’ve not sorted out is, even though I have Australia/Victoria as the default timezone (it’s in the Servoy.Properties file), when I reboot Servoy it’s back to GMT on the Prefs>Locale page. I’m not sure if this is a bug, or if a plugin is messing with the settings.