We backup our database every night at 3:00 AM CT. 15 minutes prior to this (i.e. 2:45 AM) I would like to display a warning. How do I compare the current time <dtml-var "(ZopeTime()).toZone('US/Central')"> to 3:00 AM Central Time ????? <dtml-if "(ZopeTime()).toZone('US/Central') - 0.3"> doesn't work. Any thoughts??? Dan
Try... <dtml-if "(ZopeTime()).toZone('US/Central').h_24() == 2 and (ZopeTime()).toZone('US/Central').minute() >= 45"> <dtml-comment>Time to show backup warning!</dtml-comment> </dtml-if> Daniel Rusch wrote:
We backup our database every night at 3:00 AM CT. 15 minutes prior to this (i.e. 2:45 AM) I would like to display a warning. How do I compare the current time <dtml-var "(ZopeTime()).toZone('US/Central')"> to 3:00 AM Central Time ?????
<dtml-if "(ZopeTime()).toZone('US/Central') - 0.3"> doesn't work.
Any thoughts???
Dan
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Fri, 06 Oct 2000, Daniel Rusch wrote:
We backup our database every night at 3:00 AM CT. 15 minutes prior to this (i.e. 2:45 AM) I would like to display a warning. How do I compare the current time <dtml-var "(ZopeTime()).toZone('US/Central')"> to 3:00 AM Central Time ?????
<dtml-if "(ZopeTime()).toZone('US/Central') - 0.3"> doesn't work.
Any thoughts???
Either convert to Unix time (seconds since the epoch) by coercing the date to an integer, or try something like: <dtml-if "_.DateTime('%s 3:00 US/Central' % (_.DateTime().toZone('US/Central'))) == _.DateTime()"> _.DateTime('%s 3:00 US/Central' % (_.DateTime().toZone('US/Central'))) works for me to create '3am today' US/Central time...
Dan
Curtis
participants (3)
-
Curtis Maloney -
Daniel Rusch -
Ryan M. Dolensek