What is the correct DateTime format in WebSQL to perform date comparison queries?

552 views Asked by At

I have an existing table that stored all fields with datetime data types in the following format:

Tue Jun 09 2015 08:39:56 GMT-0300 (Atlantic Daylight Time)

This seems to be the wrong format to be used with HTML5's WebSQL databases.

How can I go from this format, to an acceptable format that I could query for records after / before / between a certain date and time?

Also, what would be the easiest way to replace each records? Select all, do the replacement via Javascript, then update all? Or is there a way to do it only with SQL (for WebSQL, that is)?

Note: The datetime data was originally populated with Javascript's new Date() object, and it was just passed directly (so essentially it invoked it's toString() method). Is there some other method that would store the data directly in the database in its acceptable format (for comparing dates)?

0

There are 0 answers