Wrong date format in database

Questions, tips and tricks and techniques for scripting in Servoy

Wrong date format in database

Postby lopamudram » Mon Apr 13, 2015 9:13 am

Hello,

We are facing one random issue on date columns. The date entry fields has dd/MM/yyyy as dispay format and ddMMyy as edit format. When we enter date e.g 010101
it shows correct value on screen i.e 01/01/2001 but in database it is being stored as 2001-01-01 BC. Not sure when and why the "BC" is getting appended to the date value. This is affecting all the filters, find search and compare operations.

- Can reproduce issue with other edit formats.
- All the dates which are affected are post 01/01/2000.
- "BC" is getting appended to both DATE and DATETIME columns.
- Servoy version 7.4.2.

Any solution will be appreciated. Thanks in advance.

Lopamudra
[email protected]
lopamudram
 
Posts: 20
Joined: Wed May 02, 2012 12:05 pm

Re: Wrong date format in database

Postby jcompagner » Thu May 21, 2015 10:37 am

if you read such a date back from the database wat does datefield.getTime() tells you (whats the millis as a number)

and what does that getTime() tells you just before you save?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 7978
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Methods

Who is online

Users browsing this forum: Majestic-12 [Bot] and 7 guests