push_date and send_date are stored with the wrong timezone

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

Bug Description

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

Related branches

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

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  Edit
Everyone can see this information.

Other bug subscribers