time zone

24 views
Skip to first unread message

skac...@gmail.com

unread,
Apr 20, 2015, 2:14:57 PM4/20/15
to firewo...@googlegroups.com

Time is off in a weird way when I run work flows.

MongoDB as I understand is UTC only and it does not care about anything else. So it is up to application to adjust for timezone differences.

My server:
Mon Apr 20  14:09:48 EDT 2015

Mongo:
ISODate 2015-04-20T18:10:38.7532"

Fireworks:
same as mongo

Is there anything I can do to get conversion going between UTC and EDT?


Anubhav Jain

unread,
Apr 22, 2015, 6:43:07 PM4/22/15
to firewo...@googlegroups.com, skac...@gmail.com
Hi,

Datetimes are a bit tricky; FWS has not been the greatest at handling this in the past. The issue is that while Mongo supports ISODate objects, JSON does not have a standard format for dates. The best policy would probably have been for FWS to use Mongo's ISODate throughout such that the dates stored would be rich objects that could be converted easily between time zones (by the application). For a mix of reasons, this is not always the case and FWS sometimes includes string representations of UTC time.

You can certainly convert on the application side; FWS does this in its serializers via the "reconstitute_dates" method, which can turn string representations into Python date objects. However, everything is still converted client side.

If there's any specific change that could be made to help this process, please let me know

skac...@gmail.com

unread,
Apr 27, 2015, 10:51:48 AM4/27/15
to firewo...@googlegroups.com, skac...@gmail.com


Hi Anubhav,
I forked fireworks project and implemented fix for time zone.
It works on client side in fw_serializers.py module.
My question is this:
I am leaving mongo iso dates to be as they are UTC tz. I am on the fly applying an offset in tz in reconstitute_dates and that works correctly in gui and on command line.
One thing that I would like to implement is ability on the setup of module as py library dynamic discovery of local tz and some sort of template variable in form like this
ET = pytz.timezone("America/New_York")  
that could be utilized for calculating offset.

Your thought on how this can be done?

--sasha

skac...@gmail.com

unread,
May 12, 2015, 10:32:22 AM5/12/15
to firewo...@googlegroups.com, skac...@gmail.com
Hi Anubhav,
Do you want timezone client addon to be merged for eval into the project?
Just let me know...

Anubhav Jain

unread,
May 12, 2015, 2:06:28 PM5/12/15
to Sasha Kacanski, firewo...@googlegroups.com
>> Do you want timezone client addon to be merged for eval into the project?
Sure, that would be great!

Regarding the time zone config, maybe it is something that can be added to the FWConfig.yaml (see fw_config.py or http://www.pythonhosted.org/FireWorks/config_tutorial.html)? e.g. add something like TIME_ZONE_SETTING=America/New_York

Best,
Anubhav

--
You received this message because you are subscribed to the Google Groups "fireworkflows" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fireworkflow...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fireworkflows/5e473cd8-6d96-4379-9b72-12553ec90905%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages