Replies: 1 comment
-
I don't think there's anything to fix in If you want all days to have 24 hours in your calendar, you should simply hard-code this behavior instead of relying on One pitfall to test and be aware of in the GMT to BST transition is that 1AM local time doesn't actually exist. If you try to create a Date instance with that time it'll make it 2AM. Hope this helps. // in node.js
process.env.TZ = 'Europe/London'
console.log('GMT -> BST')
for (let i = 0; i < 24; i++) {
console.log(new Date(2022, 2, 27, i).toString())
}
console.log('BST -> GMT')
for (let i = 0; i < 24; i++) {
console.log(new Date(2022, 9, 30, i).toString())
} Output GMT -> BST
Sun Mar 27 2022 00:00:00 GMT+0000 (Greenwich Mean Time)
Sun Mar 27 2022 02:00:00 GMT+0100 (British Summer Time) <--
Sun Mar 27 2022 02:00:00 GMT+0100 (British Summer Time) <--
Sun Mar 27 2022 03:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 04:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 05:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 06:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 07:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 08:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 09:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 10:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 11:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 12:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 13:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 14:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 15:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 16:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 17:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 18:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 19:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 20:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 21:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 22:00:00 GMT+0100 (British Summer Time)
Sun Mar 27 2022 23:00:00 GMT+0100 (British Summer Time)
BST -> GMT
Sun Oct 30 2022 00:00:00 GMT+0100 (British Summer Time)
Sun Oct 30 2022 01:00:00 GMT+0100 (British Summer Time)
Sun Oct 30 2022 02:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 03:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 04:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 05:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 06:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 07:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 08:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 09:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 10:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 11:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 12:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 13:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 14:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 15:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 16:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 17:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 18:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 19:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 20:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 21:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 22:00:00 GMT+0000 (Greenwich Mean Time)
Sun Oct 30 2022 23:00:00 GMT+0000 (Greenwich Mean Time) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello - currently am using the following code to create a calendar:
BST switched to GMT last night meaning we gained an extra hour in the UK. The Array is now returning 25 items (two 1ams) - is this able to be fixed/updated by date fns?
Beta Was this translation helpful? Give feedback.
All reactions