Hi all,

We are displaying 'Printed On' date/time on our ODT reports using:
<FORMAT_DATE(DATETIME.DATE.TODY(),USER.LANGUAGE)>
<DATETIME.DATE.TODAY().STRFTIME('%H:%M:%S')>

But it is displaying date/time in UTC; i.e. it is not taking into account our 
timezone. 

On some reports, this issue is resolved by calling a method in the Report class 
which just adjusts the date as under:

datetime.astimezone(dt.replace(tzinfo=pytz.utc), timezone)

where 'dt' is the date to be adjusted and 'timezone' is the required timezone.

My question is, is there any way that we can do this adjustment in the report 
and eliminate the need of writing/calling method just to get the date adjusted?

By the way, I tried to use the same line to adjust the date but it gives error 
on 'pytz'. How can I import it in my reports? And, which python packages are 
by-default available in reports?

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/4a9c3712-ab9c-42d7-88f1-41620ce67444%40googlegroups.com.

Reply via email to