Closed Bug 1804738 Opened 3 years ago Closed 3 years ago

`nsIGleanDatetime.set` says it takes millis, but it takes a PRTime which is nanos

Categories

(Toolkit :: Telemetry, defect, P3)

defect

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: chutten, Assigned: chutten)

Details

Attachments

(1 external file)

The docs for nsIGleanDatetime.set say

  • @param aValue The time value in milliseconds since epoch. Defaults to local now.

That's not actually true, since it takes a PRTime. As you can see from this test, this means nanoseconds.

We should update the jsdoc, and double-check any other docs and code around that method to double-check that this is an isolated docbug.

While here, it would be nice if the JSDoc made it clear that the time_unit impacts only the stored resolution, and perhaps guided the user to consider the timezone, which can lead to some surprising results, i.e., day units that have non-zero hours because they are rounded in UTC time and presented in the local timezone.

Summary: nsiGleanDatetime.set says it takes millis, but it takes a PRTime which is nanos → `nsIGleanDatetime.set` says it takes millis, but it takes a PRTime which is nanos
Assignee: nobody → chutten
Status: NEW → ASSIGNED
Pushed by chutten@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e5194b153264 Update datetime metric jsdoc to clarify time and timezone info r=nalexander DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: