The DTML User Guide has an "Appendix A" that shows lot's of options, but no
examples. Anyhow, see:

You can use these like so:

        <dtml-var ZopeTime fmt=="%Y/%m/%d">

        <dtml-var ZopeTime fmt=="AMPM">

        <dtml-call "REQUEST.set('d_Date',ZopeTime().strftime('%Y/%m/%d'))">
        <dtml-var d_Date>

        <dtml-call "REQUEST.set('d_Date',ZopeTime().strftime('AMPM'))">
        <dtml-var d_Date>

You can also use Python slicing syntax to do something
totally ridiculous like this:

<dtml-call "REQUEST.set('z_t',ZopeTime())">
<dtml-call "REQUEST.set('z_sec',">
<dtml-call "REQUEST.set('day_t',_.string.split(_.str(z_t))[1])">
<dtml-call "REQUEST.set('hour_sec',,':')[0]) *
<dtml-call "REQUEST.set('min_sec',,':')[1]) *60)">
<dtml-call "REQUEST.set('sec_t',_.string.split(day_t,':')[2])">
<dtml-call "REQUEST.set('sec_sec',,'.')[0]))">
<dtml-call "REQUEST.set('sum_sec', hour_sec + min_sec + sec_sec - 1)">
<dtml-call "REQUEST.set('start_sec', - sum_sec)">
<dtml-call "REQUEST.set('end_sec', start_sec + 86398)">

<dtml-var "_.DateTime(start_sec)" fmt="AMPM"><br>
<dtml-var "_.DateTime(end_sec)" fmt="AMPM"><br>

to find the first and last seconds of a date.

Have a good time!
Jerry S.

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to