[Zope] Re: Integer in Datum umwandeln

Wolfram Kraus kraus at hagen-partner.de
Fri Oct 8 02:34:47 EDT 2004


Hey Holger! Wrong language or wrong list ;-)

Holger Butschek wrote:
> Wie wandele ich eine Zahl in ein datum um. Ich möchte eine Übersichtsseite
> für eGroupware auf meinem Zope-Server bereitstellen. In der MySQL liegt das
> Datum in einem int(11)-Feld gespeichert. Ein Beispiel 1095780422. Wie kann
> ich hieraus ein Datum ermitteln?
> 
> Viele Grüße,
> Holger
> 

Just use that int value to create an DateTime-Object:
t = DateTime(1095780422)
Then you can format the output of your date with strftime, e.g.:
timestring = t.strftime('%Y-%m-%d')
Just take a look at the DateTime-API in the Zope help.

HTH
Wolfram



More information about the Zope mailing list