[Zope] DateTime: Get DateTime-Objekt from
german dateformat %d.%m.%Y
Philip Kilner
phil at xfr.co.uk
Thu Mar 3 08:44:08 EST 2005
Hi Patrick,
Patrick Ulmer wrote:
>>> i have a litte problem to insert my german dateformat into my
>>> SQL-Database, because I must convert it to ISO-Format. I try
>>>
>>> datum=_.DateTime (wiedervorlage).ISO())
>>>
>>> but day and month ar interchanged.
>>
>> That's why it is called ISO format which is defined in the way you see
>> it.
>
> No. this is not the Problem. '1.3.2005' (D/M/Y) ist converted to
> '2005-01-03' but for germany '2005-03-01' is correct.
>
So the ISO function is working fine, but it mis-interprets your D/M/Y
input as M/D/Y - e.g. it thinks it is a US format date.
>>> How can I convert my datestring '1.3.2005' to '2005-03-01'?
>>
>> Look at the DateTime API -> somedate.strftime(formatstring)
>
> I know this function but my problem is to get "somedate" from my german
> formated (D/M/Y) datestring.
>
Where does this string originate?
--
Regards,
PhilK
Email: phil at xfr.co.uk / Voicemail & Facsimile: 07092 070518
"When the going gets weird, the weird turn pro."
-- Hunter S. Thompson 1937-2005. RIP.
More information about the Zope
mailing list