Search code examples
javascriptdatetimeweb-sql

Web SQL Database DateTime Field comparison


I have a web sql database table with two DateTime fields in it. I'm getting 0 rows when I issue the following command:

SELECT * FROM State WHERE LastModified > LastUploaded

But I can see in the resources tab in Chrome Inspector that there is a row where LastModified is greater than LastUploaded.

I guess I don't know what I'm even dealing with. What book should I read?


Solution

  • You can do this :

    SELECT * FROM state WHERE UNIX_TIMESTAMP(lastModified) > UNIX_TIMESTAMP(LastUploaded)

    Best regards :)