13 Aug
2001
13 Aug
'01
3:54 p.m.
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()
The constructor for DateTime makes a DateTime object of the current time. Try something like:: t = DateTime() If you want the Python 'time' module's floating point seconds-since-epoch format, you can say:: secs = t.timeTime() So of course, you could do something like this to get an id:: id = `int(DateTime().timeTime())` which makes a string our of an int out of a floating point number made from the current time. The string thing may or may not be necessary. --jcc (many types)