[Zope] turn string into date

Steffen Hausmann Steffen@Hausmann-family.de
Thu, 24 Jan 2002 17:17:12 +0100


Andreas Jung wrote:

> DateTime('2002/01/18 21:34:18.4746 GMT+1' ).strftime('%m') should 
> work. In your example you just assign a *representation* of the date
> to a string instead of passing the representation to the constructor
> of the DateTime class.


'DateTime('2002/01/18 21:34:18.4746 GMT+1' ).strftime('%m')' works fine, 
but it was only an example that I set 'lastDate' manualy in the script ( 
I thought it wouldn't make a difference, but it somehow does ).

In reality 'lastDate' is passed to the script by a dtml-method which 
gets the date from an object's bobobase_modification_time.

I tried 'DateTime( lastDate ).strftime( '%m' )' but I got a type error:

Error Type: Invalid Date-Time String
Error Value:

If I change the script into 'return lastDate' it returns something like 
'2002/01/18 21:34:18.4746 GMT+1'.

Thanks anyhow
Steffen

-- 
Es gibt keine perfekten Menschen, nur perfekte Absichten.