oops, to be specific here's what I'm seeing:

   datetime.datetime.now().strftime("%c %Z") ==> Thu Mar 10 14:57:31 2016   
 (i.e. timestamp is in CST with no timezone info)
   os.environ['TZ'] ==> America/Chicago

where dev_appserver and standard GAE return:

   datetime.datetime.now().strftime("%c %Z") ==> Thu Mar 10 21:00:14 2016   
 (i.e. timestamp is in UTC with no timezone info)
   os.environ['TZ'] ==> 'UTC'

adam

On Thursday, March 10, 2016 at 12:32:07 PM UTC-8, Adam Sah wrote:
>
> Here's what I've tried so far...
>  - set os.environ['TZ'] to 'UTC' on startup - failed because GAE 
> overwrites this.
>  - set os.environ['TZ'] to 'UTC' on each call by creating a child class to 
> webapp.WSGIApplication and adding it to __call__() - failed because GAE 
> overwrites this.
>  - monkeypatching datetime.datetime.now() to use a specially hacked 
> function - failed because GAE disallows modifying now()
>
> I'm currently trying a hack to rewrite all calls (100+) 
> to datetime.datetime.now() to instead use an app-specific implementation 
> which returns the UTC time - this won't work for third party libraries, but 
> that maybe OK for my app, which uses pylint custom rules to migrate 
> engineers to using app-specific replacement functions (e.g. we disallow 
> direct calls to gc.collect() so we can track stats better).  If this works, 
> I'll post.
>
> adam
>
>
> On Wednesday, March 9, 2016 at 1:45:54 PM UTC-8, Adam Sah wrote:
>>
>> e.g. os.environ['TZ'] changed to America/Chicago when before it was UTC.
>>
>> The docs don't mention this difference anywhere.
>>
>> If anyone has a workaround, pls reply - I'm working on a workaround now, 
>> will post if successful.
>>
>> hope this helps,
>> adam
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/67e76fa0-15c7-4381-8fd6-19f42e329cef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to