[Zope] How can I import DateTime into a script??
Gitte Wange
gitte@babytux.dk
Sun, 12 Aug 2001 12:50:37 +0200
At 12:20 11-08-2001 +0200, you wrote:
> Hi there, I am trying to create an Id based on the time of its
>creation. since I can not use the Pythons thime module I would like to use
>a DateTime class. However I stumbled trying to do so. the following
>code: import DateTime t = DateTime.Time() produces an error Error Type:
>AttributeError
>Error Value: Time
> whereas: from DateTime import Time
> = DateTime.Time()
> produces Error Type: ImportError
>Error Value: import of "Time" from "DateTime" is unauthorized
> can anybody tell me how to do it correctly? thanks Robert
Are you trying to do this from FS or from a Zope Python Script ??
Anyways you need to do something like this:
DateTime().Time()
If you are doing this from Zope you don't need to import the DateTime
module - it's there already.
Gitte