Recently moved to a new server farm and am having a problem with dates from MySQL that are rendered using strftime. The date in MySQL is correct (e.g. 2005-01-22) but if the date is rendered with strftime the date displayed is one day earlier (e.g., 2005-01-21). MySQL and Zope are on separate servers as they were before the switch to the new servers but this didn't happen in the old environment. Anyone have any thoughts on this? Thanks, Kevin
+-------[ Kevin Carlson ]---------------------- | Recently moved to a new server farm and am having a problem with dates | from MySQL that are rendered using strftime. The date in MySQL is | correct (e.g. 2005-01-22) but if the date is rendered with strftime the | date displayed is one day earlier (e.g., 2005-01-21). MySQL and Zope | are on separate servers as they were before the switch to the new | servers but this didn't happen in the old environment. | | Anyone have any thoughts on this? Sounds like something is applying a timezone transformation. Check the timezones on both the servers... -- Andrew Milton akm@theinternet.com.au
Turns out that the times and timezones are the same on all machines. In doing some other reading online I discovered an email where same thing was happening with PostgreSQL. The other interesting thing is that MySQL DATE columns are displayed as one day earlier but MySQL DATETIME columns are displayed correctly (although before passing to strftime both return the same date in Zope). Did the implementation of strftime change in regards to how it renders dates that are passed in different formats? Thanks, Kevin Andrew Milton wrote:
+-------[ Kevin Carlson ]---------------------- | Recently moved to a new server farm and am having a problem with dates | from MySQL that are rendered using strftime. The date in MySQL is | correct (e.g. 2005-01-22) but if the date is rendered with strftime the | date displayed is one day earlier (e.g., 2005-01-21). MySQL and Zope | are on separate servers as they were before the switch to the new | servers but this didn't happen in the old environment. | | Anyone have any thoughts on this?
Sounds like something is applying a timezone transformation. Check the timezones on both the servers...
On 2/25/06, Kevin Carlson <khcarlso@bellsouth.net> wrote:
Turns out that the times and timezones are the same on all machines. In doing some other reading online I discovered an email where same thing was happening with PostgreSQL. The other interesting thing is that MySQL DATE columns are displayed as one day earlier but MySQL DATETIME columns are displayed correctly (although before passing to strftime both return the same date in Zope). Did the implementation of strftime change in regards to how it renders dates that are passed in different formats?
Yes, loads of times. :-) And this problem pops up all the time. But for some reason, everytime it pops up, we ask for a reproducibale testcase, and nobody can provide it. :-) So, can you provide a reproducible testcase, so we can figure out of it really is a bug or not? -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
It is likely to be a problem with timezones. Zope recognizes one particular date format as UTC and not local. If that sounds like the problem, I can provide a patch. On Sat, 25 Feb 2006, Kevin Carlson wrote:
Recently moved to a new server farm and am having a problem with dates from MySQL that are rendered using strftime. The date in MySQL is correct (e.g. 2005-01-22) but if the date is rendered with strftime the date displayed is one day earlier (e.g., 2005-01-21). MySQL and Zope are on separate servers as they were before the switch to the new servers but this didn't happen in the old environment.
Anyone have any thoughts on this?
Thanks,
Kevin _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
--
participants (4)
-
Andrew Milton -
Dennis Allison -
Kevin Carlson -
Lennart Regebro