the type of CreationDate is integer.
The CreationDate is inserted with strftime('%s', '1970-01-01 00:00:00.000')

need to check which value is written to the database. 
I also tried without milliseconds - same result.


-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Keith Medcalf
Gesendet: Montag, 25. November 2019 22:41
An: SQLite mailing list
Betreff: Re: [sqlite] wrong timestamp using strftime('%s')





--
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.

On Sunday, 24 November, 2019 13:21, Dominik Ohnezeit 
<dominik.ohnez...@timeless-games.com> wrote:

>I am trying to convert a date to timestamp, but after the conversion 
>with
>strftime('%s') the integer result is wrong

>Example:

>I insert a integer timestamp into a integer table column named 
>CreationDate with strftime('%s', '1970-01-01 00:00:00.000')

>After getting it from the table with

>datetime(CreationDate, 'unixepoch')

>or

>datetime(CreationDate)

>the date I get back is not 1970-01-01 00:00:00.000 but 1969-12-31 
>22:29:11.000

This corresponds to Unixepoch time -5449

However, the builtin datetime function does not return milliseconds, only 
seconds, so it cannot return a text string ending in .000

>Does anyone know why?

Your wrapper is probably mucking about with the ISO timestring.

What is the value and type of CreationDate?



_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to