Greetings, In my current project, I have to print a lot of dates. Fine, not a problem... _.DateTime().strftime() is just the method, right? Wrong. The people who want this site want the local time, not UTC+0 that strftime enforces. So, I created a tiny patch which adds _.DateTime().strfltime(), which works identically, except it passes LOCALTIME instead of GMTIME. It's tiny, it's simple, but it's REALLY HANDY! Have a better one, Curtis Maloney. <dtml-var standard_work_disclaimer>
Hi, I am a newbie to zope and squish. My squishdot starts giving errors after midnight. the offending error is Unrecognised Time Zone in DateTime.py I am on GMT+530(India). As i donot know python, can you please tell where i should add this timezone in DateTime.py, so this problem is resolved. Thanks Rajil Saraswat On Fri, 7 Jul 2000, Curtis Maloney wrote:
Greetings,
In my current project, I have to print a lot of dates. Fine, not a problem... _.DateTime().strftime() is just the method, right?
Wrong.
The people who want this site want the local time, not UTC+0 that strftime enforces.
So, I created a tiny patch which adds _.DateTime().strfltime(), which works identically, except it passes LOCALTIME instead of GMTIME.
It's tiny, it's simple, but it's REALLY HANDY!
Have a better one, Curtis Maloney.
<dtml-var standard_work_disclaimer>
On Fri, 07 Jul 2000, Rajil Saraswat wrote:
Hi, I am a newbie to zope and squish. My squishdot starts giving errors after midnight. the offending error is Unrecognised Time Zone in DateTime.py I am on GMT+530(India). As i donot know python, can you please tell where i should add this timezone in DateTime.py, so this problem is resolved.
The patch file i supplied can be applied to /lib/python/DateTime/DateTime.py If you don't have the unix tool 'patch', you could add the lines manually, at the lines mentioned at the top of the patch file. This is, i should have mentioned, made against zope 2.1.6
From a quick perusal of the source code, it looks like there is no GMT+0530 supported currently, nor does the word "india" appear, except in the word 'Indiana'. A minor oversight, I'm sure.
If you are feeling brave, you could try adding your timezone to the _zlst array, at about line 163 in DateTime.py, then restart ZOPE.
Thanks Rajil Saraswat
Have a better one, Curtis.
participants (2)
-
Curtis Maloney -
Rajil Saraswat