Hello,

Say I got an unix epoch, e.g. 1030561675:

> select datetime( 1030561675, 'unixepoch', 'utc' );
2002-08-28 19:07:55

Say I only need the date part of it:

> select date( 1030561675, 'unixepoch', 'utc'  );
2002-08-28

Say, I would like to convert that date to a julian day:

> select julianday( date( 1030561675, 'unixepoch', 'utc'  ) );
2452514.5

Oooops... where does that .5 comes from?

I was more expecting the following:

> select cast( julianday( date( 1030561675, 'unixepoch', 'utc' ) ) as integer );
2452514

So how come does julianday take the time part of date into consideration even 
when it's not provided?

JD 2452514.500000 is
CE 2002 August 28 00:00:00.0 UT  Wednesday

JD 2452514.000000 is
CE 2002 August 27 12:00:00.0 UT  Tuesday

Or did I miss something?

Thanks in advance.


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

Reply via email to