Closed Bug 291650 Opened 20 years ago Closed 20 years ago

All FAQs reported as being edited on December 31, 1969 11:59:59pm

Categories

(addons.mozilla.org Graveyard :: Administration, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: cso, Assigned: cso)

References

()

Details

Attachments

(1 file)

The FAQ manager reports all times as being edited on December 31, 1969
11:59:59pm which is obviously wrong.

Fix shortly.
Attached patch Patch v1Splinter Review
Attachment #181669 - Flags: first-review?(mike.morgan)
Looks good to me.
Status: NEW → ASSIGNED
Can you explain to me what's wrong with the code?  Are we doing a bad conversion
and losing the data?  In other words, why is $date = $row["lastupdated"] wrong?

Your method is definitely cleaner, I just want to understand why this broke.
The output from my Database on Chameleon is:

mysql> SELECT id, lastupdated as orig, UNIX_TIMESTAMP(lastupdated) as lastupdate
d FROM `faq` ORDER BY `index` ASC, `title` ASC;
+----+---------------------+-------------+
| id | orig                | lastupdated |
+----+---------------------+-------------+
|  2 | 2004-06-13 19:31:32 |  1087180292 |
|  1 | 2005-04-16 09:59:30 |  1113670770 |
|  4 | 2005-04-16 09:55:23 |  1113670523 |
|  3 | 2004-06-13 19:31:32 |  1087180292 |
|  5 | 2004-06-13 19:31:32 |  1087180292 |
|  6 | 2004-06-13 19:31:32 |  1087180292 |
+----+---------------------+-------------+

'orig' appears to be a mySQL timestamp, which is then parsed wrongly in PHP, as
it looks like the column index are out. For example the date parsed by PHP for
the first line is "2004--0-6- 13: 1:9:".
Assignee: colin.ogilvie → Bugzilla-alanjstrBugs
Status: ASSIGNED → NEW
The output from my Database on Chameleon is:

mysql> SELECT id, lastupdated as orig, UNIX_TIMESTAMP(lastupdated) as lastupdate
d FROM `faq` ORDER BY `index` ASC, `title` ASC;
+----+---------------------+-------------+
| id | orig                | lastupdated |
+----+---------------------+-------------+
|  2 | 2004-06-13 19:31:32 |  1087180292 |
|  1 | 2005-04-16 09:59:30 |  1113670770 |
|  4 | 2005-04-16 09:55:23 |  1113670523 |
|  3 | 2004-06-13 19:31:32 |  1087180292 |
|  5 | 2004-06-13 19:31:32 |  1087180292 |
|  6 | 2004-06-13 19:31:32 |  1087180292 |
+----+---------------------+-------------+

'orig' appears to be a mySQL timestamp, which is then parsed wrongly in PHP, as
it looks like the column index are out. For example the date parsed by PHP for
the first line is "2004--0-6- 13: 1:9:".
Assignee: Bugzilla-alanjstrBugs → colin.ogilvie
Status: NEW → ASSIGNED
Ok, so it didn't need all that, you could have just move over like 1 character.
 Although I'd be perfectly happy using the mySQL format of it anyways.
Comment on attachment 181669 [details] [diff] [review]
Patch v1

Works for me.  Thanks, Colin.
Attachment #181669 - Flags: first-review?(mike.morgan) → first-review+
Would have been cool to do it with MySQL DATE_FORMAT(), but this does the job
just as well -- and UMO 2.0 will come out before 2030 or whatever it is.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: