date-fns-timezone icon indicating copy to clipboard operation
date-fns-timezone copied to clipboard

Does this library considers day light saving for time zones?

Open dulajra opened this issue 6 years ago • 1 comments

dulajra avatar Dec 06 '18 14:12 dulajra

It does.

You can also test this yourself, something like this

const { convertToTimeZone } = require('date-fns-timezone')

convertToTimeZone("2019-08-01T03:14:00Z", {timeZone: "US/Pacific"}) + ""
// 'Wed Jul 31 2019 20:14:00 GMT-0700 (Pacific Daylight Time)'

convertToTimeZone("2019-12-01T03:14:00Z", {timeZone: "US/Pacific"}) + ""
// 'Sat Nov 30 2019 19:14:00 GMT-0800 (Pacific Standard Time)'

Notice the Daylight/Standard differences as well as the difference in offset hours whether it's daylight saving time or not.

mattdodge avatar Nov 19 '19 04:11 mattdodge