the ~ubuntu-branches import makes wrong timestamps (time zone mess)
Bug #475983 reported by
Tormod Volden
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
brz-debian |
Triaged
|
Medium
|
Unassigned | ||
bzr-builddeb |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Example:
http://
The debian/changelog says "Tue, 13 Oct 2009 13:48:03 -0700".
The web interface says just "2009-10-13 14:48:03" which could be my local time (UTC+1) if the changelog date is mistaken as UTC by dropping the -0700.
Branching the repo, bzr log says "timestamp: Tue 2009-10-13 06:48:03 -0700" which is definitely wrong. So it seems it parses the changelog date as UTC ignoring the -0700, but still writes out the now wrong date in the original -0700 format.
affects: | launchpad → bzr-builddeb |
Changed in bzr-builddeb: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in brz-debian: | |
status: | New → Triaged |
importance: | Undecided → Medium |
To post a comment you must log in.
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)
timestamp = (time.mktime( time_tuple[ :9]), time_tuple[9])
author = safe_decode( cl.author)
if time_tuple is not None:
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])