push_date and send_date are stored with the wrong timezone

Bug #1086393 reported by Olivier Macchioni
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Report - Printing and Sending
Fix Released
Undecided
Guewen Baconnier @ Camptocamp

Bug Description

They should be converted to UTC before being saved in the DB

Related branches

Revision history for this message
Olivier Macchioni (olivier-macchioni) wrote :

This helper function can help (assuming the OpenERP server is in the same timezone as the pingen server)

def to_utc_time(time):
    if isinstance(time, (str, unicode)):
        time = datetime.strptime(time, '%Y-%m-%d %H:%M:%S')
    assert isinstance(time, datetime)
    from_zone = tz.tzlocal()
    to_zone = tz.tzutc()
    time = time.replace(tzinfo=from_zone)
    return time.astimezone(to_zone)

Changed in report-print-send:
assignee: nobody → Guewen Baconnier @ Camptocamp (gbaconnier-c2c)
status: New → Confirmed
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Pingen servers are in GMT+1 (with daylight saving option).

I'll fix that. Thanks Olivier

Changed in report-print-send:
status: Confirmed → In Progress
Changed in report-print-send:
status: In Progress → Fix Committed
Changed in report-print-send:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.