Skip to content

Commit b6e72f5

Browse files
timneutkensarunoda
authored andcommitted
Use UTC time to avoid time differences (vercel#782)
1 parent 8318f5b commit b6e72f5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/with-mobx/components/Clock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ export default (props) => {
1919
)
2020
}
2121

22-
const format = t => `${pad(t.getHours())}:${pad(t.getMinutes())}:${pad(t.getSeconds())}`
22+
const format = t => `${pad(t.getUTCHours())}:${pad(t.getUTCMinutes())}:${pad(t.getUTCSeconds())}`
2323

2424
const pad = n => n < 10 ? `0${n}` : n

examples/with-redux/components/Clock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ export default ({ lastUpdate, light }) => {
1919
)
2020
}
2121

22-
const format = t => `${pad(t.getHours())}:${pad(t.getMinutes())}:${pad(t.getSeconds())}`
22+
const format = t => `${pad(t.getUTCHours())}:${pad(t.getUTCMinutes())}:${pad(t.getUTCSeconds())}`
2323

2424
const pad = n => n < 10 ? `0${n}` : n

0 commit comments

Comments
 (0)