mktime, how to handle dates before 01-01-1970 ?

Ben Finney ben+python at benfinney.id.au
Mon Oct 5 21:06:53 EDT 2009


Stef Mientki <stef.mientki at gmail.com> writes:

> I'ld expect times before 1-1-1970, simply to become negative numbers
> (I'm interested in the age of living people, so that would suffice).
>
> Is there a general solution, (other library) or would it be better to
> handle all dates in the Delphi format (number of days since 1-1-1900

There are many epochs that have been used in computing
<URL:http://en.wikipedia.org/wiki/Epoch_(reference_date)#Notable_epoch_dates_in_computing>,
all of which have their problems. Switching from the Unix epoch to some
other involves data conversion, and (as you point out) raises concerns
about library support.

If you're committed to changing the epoch anyway, I would recommend
using <URL:http://en.wikipedia.org/wiki/Astronomical_year_numbering>
(epoch at 4004 BCE) since it is widely used to unify dates referring to
human history.

-- 
 \       “The surest way to corrupt a youth is to instruct him to hold |
  `\       in higher esteem those who think alike than those who think |
_o__)                               differently.” —Friedrich Nietzsche |
Ben Finney



More information about the Python-list mailing list