Skip to content

Conversation

@simolus3
Copy link

@simolus3 simolus3 commented Dec 4, 2025

In the MySQL binlog stream, timestamps are encoded as seconds since the unix epoch. This means that the library will have to extract individual fields to represent the value if it should be emitted as a string, for which it uses new Date() and date.getHours().

Since methods like getHours() are used, this library effectively unconditionally uses the local time zone. This PR changes the logic to use UTC instead. Ideally, the timezone should respect the connection's timezone, but that isn't possible without the temporal API which is not yet available. Since we're always using UTC in the PowerSync service, this ensures the values this package emits are in the format we expect.

(This is technically covered by existing tests, they just passed because GH actions runs in UTC)

@simolus3 simolus3 requested a review from Rentacookie December 4, 2025 11:02
@simolus3 simolus3 merged commit 6ac1d60 into main Dec 4, 2025
2 checks passed
@simolus3 simolus3 deleted the timestamp-utc branch December 4, 2025 11:15
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.

3 participants