An alternative to perhaps consider is an expanded range Unix epoch-
like timestamp. The Postgres timestamp type is stored as a 64 bit
integer, with 1 microsecond resolution.

SQLite supports storing integers with up to 8 bytes, so it would be
feasible to mimic the internal storage of a Postgres timestamp value
in SQLite, and it's only a question of mathematics to convert that to
a Python datetime.

Considering that the SQLite shell is fairly limited, and not that nice
to use, I don't think it's terribly important how the values look in a
raw SQL select (eg. whether they're human readable or not).... so long
as they sort correctly, are easy to convert to/from Python types, and
can also be handled by SQLite's date/time functions (and general math
operations as needed).

I suspect that Postgres's timestamp implementation is based on the
Julian day, fit into a 64 bit integer. The Julian day is is a measure
of "the interval of time in days and fractions of a day since January
1, 4713 BC Greenwich noon" - the same earliest possible date in
Postgres.

(http://en.wikipedia.org/wiki/Julian_day)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to