Further info about ZopeTime() not returning correct values
OK, after trying some other things out, I have some updated information. <dtml-var "ZopeTime()"> OR <dtml-with ZopeTime> <dtml-var fCommonZ> </dtml-with> Returns the correct information. However, on the same page <dtml-var "ZopeTime()" fmt="%b %d %Y %I:%M:%S%p"> Returns time-5hours. Further investigation has revealed that when it is 5 hours behind, it indicates a timezone of "MST", yet when the correct time is show, it shows "US/Mountain". While it appears i can get a workaround to the correct date, something still seems amiss here... -- Bill Anderson Linux/Unix Administrator, Security Analyst ESBU (ARC) bill_anderson@boi.hp.com My opinions are just that; _my_ opinions.
I'm having some trouble with ZopeTime as well. I need the current time in the following format: yyyy-mm-dd hh:mm:ss <dtml-var "ZopeTime()"> gives the correct local time but in the wrong format. <dmtl-var "ZoptTime()" fmt="%Y-%m-%d %X"> gives the right format but uses GMT when I need local time. (I got the formats from a 'man date' under Linux) As far as I can tell as soon as I specify a fmt="" string, ZopeTime automagically starts returning GMT. So is it impossible to format _and_ to get the local time? -- Guy Davis mailto:davis@arc.ab.ca (403) 210-5334 Alberta Research Council
Guy Davis wrote:
I'm having some trouble with ZopeTime as well. I need the current time in the following format: yyyy-mm-dd hh:mm:ss
<dtml-var "ZopeTime()"> gives the correct local time but in the wrong format. <dmtl-var "ZoptTime()" fmt="%Y-%m-%d %X"> gives the right format but uses GMT when I need local time. (I got the formats from a 'man date' under Linux) As far as I can tell as soon as I specify a fmt="" string, ZopeTime automagically starts returning GMT.
So is it impossible to format _and_ to get the local time?
This fits with my experience so far. Whenever you format it, you 'change timezones' it seems. In my case it uses 'MST" which seems to be 7 hours ahead of me ... (as opposed to the -5 I had previously thought) -- Bill Anderson Linux/Unix Administrator, Security Analyst ESBU (ARC) bill_anderson@boi.hp.com My opinions are just that; _my_ opinions.
From: "Guy Davis"
As far as I can tell as soon as I specify a fmt="" string, ZopeTime automagically starts returning GMT.
Yelp, I found the code that does it. Wonder why gmtime is assumed ?
From DateTime.py def strftime(self, format): return strftime(format, gmtime(self.timeTime()))
--Darrell
participants (3)
-
Bill Anderson -
Darrell -
Guy Davis