Skip to content

Commit

Permalink
merge: pull request #8 from arough007/main
Browse files Browse the repository at this point in the history
fix: timezone issue
  • Loading branch information
reiniiriarios authored Nov 22, 2023
2 parents 618ebd9 + 0f93beb commit a6ac66e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const getTodayAsStartEndDates = (): StartEndDates => {
*/
export const getTimezone = (date: Date): string => {
const tzoff = date.getTimezoneOffset();
const h = Math.floor(tzoff / 60);
const h = Math.floor(Math.abs(tzoff) / 60);
const m = tzoff % 60;
return (tzoff < 0 ? '+' : '-') + h.toString().padStart(2, '0') + m.toString().padStart(2, '0');
}
Expand Down

0 comments on commit a6ac66e

Please sign in to comment.