Skip to content

fix(data): floor Unix timestamps when converting dates - #1106

Open
piguagua wants to merge 1 commit into
semaphore-protocol:mainfrom
piguagua:my_feature
Open

piguagua wants to merge 1 commit into
semaphore-protocol:mainfrom
piguagua:my_feature

Conversation

@piguagua

@piguagua piguagua commented Nov 8, 2026 •

Copy link
Copy Markdown

Description

Use floor rather than round when converting a JavaScript Date to Unix seconds. At 500–999 milliseconds into a second, rounding advances the timestamp into the next second. Add boundary cases around the half-second point and immediately before the Unix epoch.

Related Issue(s)

#1105

Other information

The actual TypeScript utility passed direct Node assertions for all added time boundaries. The project Jest, formatting and lint commands still need to run.

Checklist

  • I have performed a self-review of my code
  • My changes generate no new warnings
  • I have run yarn format and yarn lint without getting any errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Signed-off-by: piguagua <shabipengqi@outlook.com>
@piguagua
piguagua requested a review from a team as a code owner November 8, 2026 00:03

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant