Closed Bug 491630 Opened 15 years ago Closed 15 years ago

DateTime shouldn't have fractional "seconds" in new()

Categories

(Bugzilla :: Bugzilla-General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.4

People

(Reporter: mkanat, Assigned: mkanat)

Details

Attachments

(1 file)

Right now format_time will cause Bugzilla to die if you happen to give it a fractional seconds value greater than 59 (like 59.2). I talked to the author of DateTime, and he said that he's going to change DateTime to complain if you *ever* give it fractional seconds, so we have to make sure that format_time truncates any "seconds" values to an int().
Attached patch v1 (deleted) — Splinter Review
Assignee: general → mkanat
Status: NEW → ASSIGNED
Attachment #375935 - Flags: review?(LpSolit)
In which cases do we pass fractional seconds to format_time()?
(In reply to comment #2)
> In which cases do we pass fractional seconds to format_time()?

  During email at least, apparently, since that's when I was getting the error. In any case, this prevents it from ever causing a problem instead of us having to track down every place that it happens, every time it happens.

  I suspect it just comes from using NOW() on Pg in a few places.
Comment on attachment 375935 [details] [diff] [review]
v1

Looks good. r=LpSolit
Attachment #375935 - Flags: review?(LpSolit) → review+
Flags: approval3.4+
Flags: approval+
tip:

Checking in Bugzilla/Util.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Util.pm,v  <--  Util.pm
new revision: 1.89; previous revision: 1.88
done

3.4:

Checking in Bugzilla/Util.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Util.pm,v  <--  Util.pm
new revision: 1.86.2.3; previous revision: 1.86.2.2
done
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: