[Zope] ZopeTime().Date() confusion

2000-10-01 Thread Larry Albert

This is driving me batty.

I am trying to do something very simple. I want a method to perform an
update no more than once a day. I know there are other approaches to this
issue -- such as using bobobase_modification_time, not to mention Xron --
but I would like to use a date property for reasons I won't go into here.

I am using Zope 2.2.1. Every time the method updates, I update the date
property called last_updated with this: 

dtml-call "manage_changeProperties(last_updated=ZopeTime().Date())"

This gives me a date that appears to be accurate, such as 2000/10/01. Then,
every time the page gets called, I want to check to see if it is time to
call the method, so I use:

dtml-if expr="last_updated.isCurrentDay()"
don't update method
dtml-else
   update method
   store new last_updated
/dtml-if

This worked fine until, at the appointed hour, last_updated began to sense
that even though it appeared to be "2000/10/01" (and even when I typed it
in that way by hand), the time in Greenwich was actually more important to
its sense of identity than was its appearance to me. So even when
ZopeTime().Date() gave me 2000/10/01, 

last_updated.isCurrentDay() 

would evaluate to false(!). So the method would update every time the page
was called. As a kluge, I changed my update command to 

dtml-call
"manage_changeProperties(last_updated=ZopeTime().toZone('GMT').Date())"

, which works, but causes the update to occur, I presume, at midnight GMT,
rather than midnight here, which would be nicer (actually, I'd love to be
able to control the precise hour updates should occur, but I can't figure
out how to do that). This is also complicated -- but not relevantly, I
hope? -- by the fact that the Zope installation seems to think the time
zone is GMT+2 rather than GMT-5 (I'm in Texas).

I understand that the previously counterintuitive use of strftime was
changed for 2.2.1 -- but I am not using strftime, I am using Date() and
isCurrentDay(). I've tried all sorts of combinations of switching time
zones but succeeded only in confusing myself.

So three questions:

1. Is there a better way to do this (still using a property called
last_updated)?

2. Does the use of Date() and isCurrentDay(), etc. still switch everything
to GMT, even though strftime was changed? If so, what is the list of
methods that compare GMT, and which that compare the local installation time?

3. This appears to be a perfect example of something that should be very
simple becoming needlessly complicated. Couldn't some more user-friendly
("beginner") time or date objects be implemented in DTML?

Thanks for any help!

Larry Albert
[EMAIL PROTECTED]



___
Zope maillist  -  [EMAIL PROTECTED]
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 )




[Zope] EVENT: First Houston Zope Users Group Meeting

2000-09-05 Thread Larry Albert

An informal Houston Zope Users Group is holding a first meeting this
Wednesday evening, September 6, at 6:30 at the Koch Building in Greenway
Plaza, Houston. Topics will be Zope and Zope-related Python.

Because access to the Koch Building is limited, we will meet promptly at
6:30 in front of the Quizno's (deli) at 3837 Richmond, near Weslayan. At
6:40, we will go into the Koch building accompanied by George Runyan. If
you are able to join us, please be there on time or you will miss us --
there is no way for visitors to get into the building if you are unescorted. 

For further information, please email George Runyan at [EMAIL PROTECTED]




___
Zope maillist  -  [EMAIL PROTECTED]
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 )