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)
Tracking
(Not tracked)
RESOLVED
FIXED
1.0
People
(Reporter: cso, Assigned: cso)
References
()
Details
Attachments
(1 file)
|
1.62 KB,
patch
|
morgamic
:
first-review+
|
Details | Diff | Splinter Review |
The FAQ manager reports all times as being edited on December 31, 1969 11:59:59pm which is obviously wrong. Fix shortly.
| Assignee | ||
Comment 1•20 years ago
|
||
Attachment #181669 -
Flags: first-review?(mike.morgan)
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.
| Assignee | ||
Comment 4•20 years ago
|
||
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
| Assignee | ||
Comment 5•20 years ago
|
||
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 | ||
Updated•20 years ago
|
Assignee: Bugzilla-alanjstrBugs → colin.ogilvie
| Assignee | ||
Updated•20 years ago
|
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 7•20 years ago
|
||
Comment on attachment 181669 [details] [diff] [review] Patch v1 Works for me. Thanks, Colin.
Attachment #181669 -
Flags: first-review?(mike.morgan) → first-review+
Comment 8•20 years ago
|
||
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
Updated•9 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•