Hello,
How are the datetimes stored in the H2 database? I see a long value. Is this stored a milliseconds?
If so, how should I convert to regular date within query? I’m trying to perform some validations.
Thanks
Hello,
How are the datetimes stored in the H2 database? I see a long value. Is this stored a milliseconds?
If so, how should I convert to regular date within query? I’m trying to perform some validations.
Thanks
I think it’s timestamp format.
You need to change this to date format
From http://stackoverflow.com/questions/11839246/how-to-convert-timestamp-to-date-in-java
// timestamp to Date long timestamp = 5607059900000; //Example -> in ms Date d = new Date(timestamp );// Date to timestamp
long timestamp = d.getTime();
//If you want the current timestamp :
Calendar c = Calendar.getInstance();
long timestamp = c.getTimeInMillis();
Also See
http://stackoverflow.com/questions/11634403/h2-sql-date-comparison