Closed Bug 628631 Opened 15 years ago Closed 15 years ago

TSV export has incorrect timestamps

Categories

(Input :: General, defect)

defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: michaelk, Assigned: wenzel)

References

()

Details

(Whiteboard: [qa-])

The exported UNIX timestamps, in fact, aren't. >>> # our Exports are using calendar.timegm >>> from calendar import timegm >>> timegm.__doc__ 'Unrelated but handy function to calculate Unix timestamp from GMT.' >>> >>> # wish I had read that before doing the review >>> # you'd think timegm would give you, you know, GMT... >>> >>> from time import mktime >>> mktime.__doc__ 'mktime(tuple) -> floating point number\n\nConvert a time tuple in local time to seconds since the Epoch.' >>> >>> # aaaahaaa TL;DR: we want to use int o time.mktime instead of calendar.gmtime here https://github.com/michaelku/reporter/commit/a7864db06595898a1a12122c5fbeaefd928e6783 The bug in action: --- website (OK): http://input.stage.mozilla.com/en-US/opinion/1163642 <time datetime="2011-01-22T23:01:00Z" title="Jan 22, 2011 3:01:00 PM">2 days ago</time> -- database (system timezone dependent, but OK): mysql> -- date adjusted cause on my system the DB runs on UTC+1 while `created` is LA time (currently UTC-8) mysql> select UNIX_TIMESTAMP(DATE_ADD(`created`, INTERVAL 9 HOUR)) as t from feedback_opinion where id=1163642; +------------+ | t | +------------+ | 1295737260 | +------------+ --- TSV export (does not make the UNIX time): 1163642 1295708460 praise firefox 4.0b9 winxp en-US facbook.com mysql> select (1295737260 - 1295708460)/3600; +--------------------------------+ | (1295737260 - 1295708460)/3600 | +--------------------------------+ | 8.0000 | +--------------------------------+ So, the timestamp in the export lags 8 hours behind ...just as I suspected *rubs hands*.
Oooh, that's no good. Thanks for writing the patch. I pulled it into master: http://github.com/fwenzel/reporter/commit/01b1659 Marking this qa-, because Michael can verify this himself. I'll have IT run the cron job once manually for us.
Whiteboard: [qa-]
Target Milestone: --- → 3.0
Jabba ran the export script for us by hand. This is fixed: Please take a look at the data now.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Now we have ... 1163642 1295737260 praise firefox 4.0b9 winxp en-US facbook.com ... And that is good --- same as mysql above!
Status: RESOLVED → VERIFIED
Component: Input → General
Product: Webtools → Input
You need to log in before you can comment on or make changes to this bug.