A customer is reporting that sometimes a datetime field set to be filled by autoenter server datetime returns a date with the year 1970 instead of the current year, the rest of the datetime is fine, only the year is wrong (look at the screenshot). He claims that the windows clock is ok and that it happens only once in a while even on different PCs.
The solution is a Runtime built with Servoy 2.2.1 build 333.
Anyone as seen a similar problem before? I’m quite clueless because I simply use the server datetime autoenter option so I don’t know how I could overcome this issue.
Any help is appreciated.
are you sure you don’'t format the data somewhere along the line where you only display the time part?
please upgrade to the latest 2.2.5 build because date handling with formats is much improved. For example only the part you set a format for is changed not the complete date.
I don’t touch the data, it is filled by autoenter with the server timestamp and only displayed in a not editable field. Upgrading to 2.2.5 could be a pain, keep in mind that it is a runtime solution.
as far as i can think of now can it only be a formatting issue. Because you do say that only the year is wrong and the rest is fine. That just means that something does sets that year part of the date wrong. This can only be done by a format (pre 2.2.4 or 2.2.5) or through javascript.
If you can’t upgrade then i don’t know what we can do about it at all. ?
I will double check to see if there’s something wrong with formats or a method touching the year part of the date.
Sure I can upgrade, I built a special module to hot-backup the db for that special purpose but I would prefer to wait for a new release, I am afraid of all the customers who will mess things up during the upgrade process… I just want to avoid a phone call storm for a single bug report ![Wink :wink:]()
Just to help others that may fall in this annoying bug:
Servoy versions before 2.2.5 have a serious bug with date fields format options: in certain situations if you display a uneditable date field formatted as “dd-MM hh:mm” the date in the backend is changed ant the year is reverted to 1970.
Ex.: date field in the DB: 21-04-2007 17:37
You show it in a form as: 21-04 17:37
It gets saved to the backend as: 21-04-1970 17:37
The problem has been fixed (but not documented) in Servoy 2.2.5
This was really annoying! ![Mad :x]()