Re: [sqlite] julianday and unixepoch

2011-09-17 Thread Petite Abeille
On Sep 17, 2011, at 10:53 PM, Kevin Benson wrote: >> Your point is taken and most likely the documentation intended merely > to identify the result in terms of Julian days: > i.e. > The julianday() function returns the number of Julian > days since noon in Greenwich on November 24, 4714 B.C. (Pro

Re: [sqlite] julianday and unixepoch

2011-09-17 Thread Kevin Benson
On Sat, Sep 17, 2011 at 4:43 PM, Petite Abeille wrote: > > On Sep 17, 2011, at 10:42 PM, Kevin Benson wrote: > > > The julianday() function returns the Julian > > day- the number of days... > > > > since noon in Greenwich on November 24, 4714 > > B.C. (Pr

Re: [sqlite] julianday and unixepoch

2011-09-17 Thread Petite Abeille
On Sep 17, 2011, at 10:42 PM, Kevin Benson wrote: > The julianday() function returns the Julian > day- the number of days... > > since noon in Greenwich on November 24, 4714 > B.C. (Proleptic > Gregorian > calendar

Re: [sqlite] julianday and unixepoch

2011-09-17 Thread Kevin Benson
On Sat, Sep 17, 2011 at 3:52 PM, Petite Abeille wrote: > > > So how come does julianday take the time part of date into consideration > even when it's not provided? > > > > In SQLite: > > > select julianday( '2002-08-28' ); > 2452514.5 > *SNIP* > I was expecting a julian day number. SQLite's jul

Re: [sqlite] julianday and unixepoch

2011-09-17 Thread Petite Abeille
On Sep 17, 2011, at 9:29 PM, Igor Tandetnik wrote: >> So how come does julianday take the time part of date into consideration >> even when it's not provided? > > It doesn't. Hmmm... http://en.wikipedia.org/wiki/Julian_day#Converting_Gregorian_calendar_date_to_Julian_Day_Number local math =

Re: [sqlite] julianday and unixepoch

2011-09-17 Thread Igor Tandetnik
Petite Abeille wrote: > 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? In Julian calendar, 0 represents noon, and .5 represents midnight. > I was more expecting t

[sqlite] julianday and unixepoch

2011-09-17 Thread Petite Abeille
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 julianda