Closed Bug 938161 Opened 11 years ago Closed 11 years ago

sql_date_format() method for SQLite has an incorrect default format

Categories

(Bugzilla :: Database, defect)

4.2.7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.2

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

Attachments

(1 file)

editusers.cgi calls $dbh->sql_date_format('profiles_activity.profiles_when') to display changes of a user account (see action eq "activity"). When no format is passed to this method, it falls back to "%Y.%m.%d %H:%M:%s", but on SQLite, %s means "seconds since 1970-01-01", see http://www.sqlite.org/lang_datefunc.html. What we want is %S.

This means that "2013.11.13 13:53:25" is displayed as "2013.11.13 13:53:1384350805".

This could potentially cause more trouble, e.g. when passed to DateTime as the string would be unparsable or return a date object with wrong data in it.
Attached patch patch, v1Splinter Review
Assignee: database → LpSolit
Status: NEW → ASSIGNED
Attachment #831535 - Flags: review?(glob)
Note that SQLite support has been added in Bugzilla 4.2, see bug 337776.
Comment on attachment 831535 [details] [diff] [review]
patch, v1

r=glob
Attachment #831535 - Flags: review?(glob) → review+
Flags: approval4.4+
Flags: approval4.2+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/DB/Sqlite.pm
Committed revision 8811.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.4/
modified Bugzilla/DB/Sqlite.pm
Committed revision 8637.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/
modified Bugzilla/DB/Sqlite.pm
Committed revision 8238.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Depends on: bz-sqlite
Resolution: --- → FIXED
Added to relnotes for 4.4.2.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: