Hello, I have a python script in my zope instance: dt=DateTime(2012,1) print dt print dt.strftime('%Y') print dt.year() return printed 2012/01/01 00:00:00 GMT+2 2011 2012 Why do I get two different values for the year (2011, 2012)? Thank you, Giampiero
On Sat, Jul 14, Giampiero Benvenuti wrote:
I have a python script in my zope instance:
dt=DateTime(2012,1) print dt print dt.strftime('%Y') print dt.year()
return printed 2012/01/01 00:00:00 GMT+2 2011 2012
Why do I get two different values for the year (2011, 2012)?
It would seem strftime defaults to a timezone "to the left" of GMT+2. \\kristian -- ... et nemo ex vobis interrogat me: "Quo vadis?"
+-------[ Kristian Thy ]---------------------- | On Sat, Jul 14, Giampiero Benvenuti wrote: | > I have a python script in my zope instance: | > | > dt=DateTime(2012,1) | > print dt | > print dt.strftime('%Y') | > print dt.year() | > | > return printed | > 2012/01/01 00:00:00 GMT+2 | > 2011 | > 2012 | > | > Why do I get two different values for the year (2011, 2012)? | | It would seem strftime defaults to a timezone "to the left" of GMT+2. strftime converts to UTC -- Andrew Milton akm@theinternet.com.au
participants (3)
-
Andrew Milton -
Giampiero Benvenuti -
Kristian Thy