Comment 1 for bug 475983

Revision history for this message
Anders Kaseorg (andersk) wrote :

The relevant code from import_dsc.py is indeed confused:

            if use_time_from_changelog and len(cl._blocks) > 0:
                 raw_timestamp = cl.date
                 import rfc822, time
                 time_tuple = rfc822.parsedate_tz(raw_timestamp)
                 if time_tuple is not None:
                     timestamp = (time.mktime(time_tuple[:9]), time_tuple[9])
                 author = safe_decode(cl.author)

time.mktime works in the system’s local time zone, which in general is different from the changelog entry’s time zone. The correct calculation is

timestamp = (calendar.timegm(time_tuple[:9]) - time_tuple[9], time_tuple[9])