SQLite Forum

Proposed slightly-incompatible change to date-time functions
Login
## Current algorithm:

  1.  If the timevalue is TEXT → ISO8601 ("YYYY-MM-DD HH:MM:SS.SSS")
  2.  If the timevalue is numeric and followed by 'unixepoch' → Seconds since 1970-01-01
  3.  If the timevalue is numeric → Days since -4713-11-24 12:00.

## Proposed New Algorithm (2nd Edition):

  1.  If the timevalue is TEXT → ISO8601 as before
  2.  If the timevalue is numeric and followed by 'unixepoch' → Seconds since 1970-01-01
  3.  If the timevalue is numeric and greater than or equal to 5373484.5 → Seconds since 1970-01-01
  4.  If the timevalue is numeric → Days since -4713-11-24 12:00.

In prose: if the timevalue is numeric, but would not make sense as a Julian
day number because it codes for a day beyond 9999-12-31, then interpret the
time value as a unix timestamp even if the 'unixepoch' modifier is omitted.
Otherwise, everything is as before.