Skip to content

Commit

Permalink
fix: ms in timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
badosz0 committed Jan 8, 2024
1 parent 9c3134b commit 1803ef4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "holy-time",
"version": "3.4.2",
"version": "3.4.3",
"description": "Utility functions",
"repository": "Yet another (type-safe) date time library",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class HolyTime {

timeZone = TIMEZONE_MAP[timeZone] ?? timeZone;

return new Date(date.toLocaleString('en-US', { timeZone }));
return new Date(new Date(date.toLocaleString('en-US', { timeZone })).setMilliseconds(0));
}

private static getUnit(unit: HumanUnit): ValueOf<typeof HolyTime.Units> {
Expand Down

0 comments on commit 1803ef4

Please sign in to comment.