Epoch time reported in different units in backend vs frontend #5

Open
opened 2026-06-08 14:04:07 -07:00 by Rich · 0 comments
Owner

Javascript Date objects are created with Unix epoch milliseconds and, by default, report the epoch time of a Date in milliseconds.

Go's time package is much more flexible, providing a number of Unix* methods to access the epoch time in different units, including milliseconds.

It's a simple enough conversion (multiply/divide by 1000 depending on which way you're going) but that feels unnecessarily fragile.

Javascript Date objects are [created with Unix epoch milliseconds](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date#value) and, by default, [report the epoch time of a Date in milliseconds](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime). Go's time package is much more flexible, providing a number of Unix* methods to access the epoch time in different units, including [milliseconds](https://pkg.go.dev/time#UnixMilli). It's a simple enough conversion (multiply/divide by 1000 depending on which way you're going) but that feels unnecessarily fragile.
Rich changed title from Standardize date format to Epoch time reported in different units in backend vs frontend 2026-06-08 14:04:26 -07:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Rich/donezo#5
No description provided.