[Zope] DateTime: Get DateTime-Objekt from german dateformat %d.%m.%Y

Patrick Ulmer ulmer at truckport.de
Thu Mar 3 10:33:18 EST 2005


Hi,

>>>> 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.


Yes, that's my problem.

>>>> 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?


 From my html-form entered by users.


More information about the Zope mailing list