[Zope] extracting day-month-year from a pre-epoch DateTime instance?

Darran Edmundson Darran.Edmundson@anu.edu.au
Wed, 16 Feb 2000 00:17:18 +1100


I have pre-epoch DateTime instance dates that
I want to render a la 

     <dtml-var birthdate fmt="%d %a %Y">

Obviously this doesn't work so I'm toying with

<dtml-let numdays="_.int(birthdate-_.DateTime('01/01/1901'))">
   [...]
</dtml-let>

where I need to compute the integer year, month and day
corresponding to numdays (since 01 jan 1901).  Seeing
that human history didn't begin in 1970, this has got
to be a common enough problem that either (i) there's
a trick such that birthdate.strftime() actually does
work or (ii) I'm missing something obvious.  

I bet on the latter as there is seemingly no mention 
of this on eGroups or the python FAQ ...

Cheers,
Darran.