I am creating a Date() object in a method and then writing that date value to a column in the database (DATETIME). The date object displays the correct date/time on a form if I put it into a form text box. However, when I store it to the database, today’s date (6-5-2008) ends up as 01-04-1970 in the database.
Any thoughts?
Are you setting a dataprovider (DATE) to that date? Or setting it directly in the DB using SQL?
If a dataprovider, Servoy should do the DB translation to put it in the correct form (via the JDBC driver). Perhaps try a newer and older JDBC driver to see if the DATETIME translation is wrong.
Personally, I work with MySQL outside of Servoy a lot, and so use a JDBC driver that I know works in other apps as the Servoy driver too.
Thanks!
I think a field is somehow caught in a corrupted state. I created a brand new field and wrote the exact same value to it at the exact same time and it worked perfectly. I’ll just drop the original column and I think the problem will go away if I stick with the new one.
This is the first time I’ve seen Servoy seem to get out of sync with the database structure. I was dropping and adding fields both in Servoy and directly in mysql, so something must have gotten bungled. Even after reboots and restarts of mysql, it’s not working on that one field.
Thanks again.