I think I see it.  This is the schema for the table:
CREATE TABLE [EventEntry](
  [EventID] INTEGER PRIMARY KEY AUTOINCREMENT,
  [IPAddress] CHAR,
  [Node] INTEGER DEFAULT 0,
  [NodeOpened] DATETIME,
  [NodeClosed] DATETIME);

When I run a select * from EventEntry I'm seeing the 'float' since
UnixEpoch, so, 43711.819791667 as an example.  So I'm comparing oranges to
apples.

Now I just need to figure out how to compare apples to apples when using
'now'.

On Sat, Sep 7, 2019 at 4:01 PM Stephen Chrzanowski <pontia...@gmail.com>
wrote:

> I'm creating a new database to keep track of time difference between
> logins and logoffs for a particular system.
>
> I have the following query:
> select  NodeOpened,
>         JulianDay(NodeOpened),
>         JulianDay('now')
> from EventEntry
> where NodeClosed is null
>
> The results are:
> NodeOpened                JulianDay(NodeOpened) JulianDay('now')
> 2019-09-03 19:29:15.000   43711.8119791667      2458734.32840103
> 2019-09-03 19:52:24.000   43711.8280555556      2458734.32840103
> 2019-09-03 20:08:54.000   43711.8395138889      2458734.32840103
>
> Reading the Wiki on Julian Day (That the SQLite DateTime formats provides)
> I understand why JulianDay is such a large number (Counting days back from
> the BC era), but I'm not understanding why the NodeOpened is such a small
> number and 'now' is such a huge number?
>
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to