[Zope] Random ID's using ZopeDate() problems...
Jos Yule
JYule@extend.com
Thu, 4 Nov 1999 16:54:21 -0500
Hello!
Ok, so i've read the how-to on generating auto ID's -
<dtml-call "REQUEST.set('ts', ZopeTime())">
<dtml-call "REQUEST.set('id', _.str(_.int(ts)))">
and I thought to myself - humm, wouldn't it be nice to have
that string of digits actually mean something.
So what i would like to do is have the string be the following
19991104164300
where is
year (4 dig)
month (2 dig)
day (2 dig)
hour (2 dig. 24 hour clock)
min (2 dig)
sec (2 dig)
not sure if the last is possible (the seconds)... ok, just looked it up, it
is.
I tried to make a dtml-method (timeObject) that would return this string -
<dtml-call "REQUEST.set('ts',ZopeTime())">
<dtml-var ts fmt="%Y%m%d%H%M%S">
and then in the object constructor ive got
(please note - i'm kind of doing this from memory)
<dtml-call "REQUEST.set('tempTime', timeObject)">
<dtml-call "REQUEST.set('id', tempTime)">
but it doesn't work...
If you made it through all of that, Thanks!!!
if you can help me, even *more* Thanks!!!
Jos Yule