change timezone in bots

79 views
Skip to first unread message

Borgee

unread,
Jan 19, 2022, 10:10:15 AM1/19/22
to Bots Open Source EDI Translator
hi all, 
how do i change the timezone setting in BOTS?  in my installation it seems the time is setto CET.  but i like to change it base don my local timezone. 

im referring to this


Done    2022-01-19 22:04:38     MY_ROUTE1    IN_CHANNEL  

any advice, please. 

thanks 

Henk-Jan Ebbers

unread,
Jan 19, 2022, 11:25:29 AM1/19/22
to bots...@googlegroups.com
in conffig.settings.py is a setting for timezone.
change and reset bots-webserver.


kind regards,
Henk-Jan Ebbers



--
You received this message because you are subscribed to the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/botsmail/1670f7d9-5489-4a92-af90-98880513ee1bn%40googlegroups.com.

David Friday

unread,
Apr 13, 2022, 3:11:30 PM4/13/22
to Bots Open Source EDI Translator
Hi, 

The current time zone that I'm in is America/Tijuana, I change it to Europe/London within config/settings.py but the ISA10 and GS05 still show the time in America/Tijuana after I have closed and restarted BOTS no change.

I would like to display UTC +0 time in ISA10 and GS05 is it possible?

Thanks,

David

Henk-Jan Ebbers

unread,
Apr 13, 2022, 5:56:48 PM4/13/22
to bots...@googlegroups.com
bots put the local date/time in the envelope, indeed.
you would have to change bots enveloping code to do that.

kind regards, henk-jan ebbers


David Friday

unread,
Apr 13, 2022, 6:03:43 PM4/13/22
to Bots Open Source EDI Translator
Thanks for the response, where would I find the bots enveloping code?

Eppye Bots

unread,
Apr 13, 2022, 6:07:43 PM4/13/22
to 'Chuck Turco' via Bots Open Source EDI Translator
in envelope.py

kind regards, Henk-Jan Ebbers


David Friday

unread,
Apr 13, 2022, 7:01:11 PM4/13/22
to Bots Open Source EDI Translator
Thanks Henk-Jan I got it to work using the following in envelope.py

from datetime import datetime 
import pytz                   

        tz_London = pytz.timezone('Europe/London')
        datetime_London = datetime.now(tz_London)

        'ISA10':datetime_London.strftime('%H%M'),
        'GS05':datetime_London.strftime('%H%M'),

Is it possible to use the above for a specific route only? 

Thanks for all your help,

David

Eppye Bots

unread,
Apr 14, 2022, 4:16:11 AM4/14/22
to 'Chuck Turco' via Bots Open Source EDI Translator
not sure if route information is passed here....

but standard says envelope date/time is date/time of moment of generating the envelope.
so why change it?


kind regards, Henk-Jan Ebbers


David Friday

unread,
Apr 14, 2022, 12:36:02 PM4/14/22
to Bots Open Source EDI Translator
I've been trying envelope scripting shown below x12.py in directory envelopescripts\x12

from datetime import datetime 
import pytz      

def envelopecontent(ta_info,out,*args,**kwargs):


    tz_London = pytz.timezone('Europe/London')
    datetime_London = datetime.now(tz_London)
    out.put({'BOTSID':'ISA','ISA09':datetime_London.strftime('%y%m%d')})
    out.put({'BOTSID':'ISA','ISA10':datetime_London.strftime('%H%M')})
    out.put({'BOTSID':'ISA'},{'BOTSID':'GS','GS04':datetime_London.strftime('%Y%m%d')})
    out.put({'BOTSID':'ISA'},{'BOTSID':'GS','GS05':datetime_London.strftime('%H%M')})

Unfortunately nothing changes so I'm not sure why it is not working.

Thanks,

David

Eppye Bots

unread,
Apr 14, 2022, 12:41:54 PM4/14/22
to 'Chuck Turco' via Bots Open Source EDI Translator
think you would have to do a change.
out.change()

see docs on h\ow to change.

kind regards,
henk-jan

David Friday

unread,
Apr 14, 2022, 12:46:06 PM4/14/22
to Bots Open Source EDI Translator
Thanks Henk-Jan for all your help.

David

Reply all
Reply to author
Forward
0 new messages