I am facing an issue related to DaylightSaving where time in America/Los_Angeles
timezone is not adjusting to the Daylight savings when I use moment(<DateTime>).tz(America/Los_Angeles)
.
>> let c = moment('2023-03-12 9:15 AM', 'YYYY-MM-DD HH:mm a').tz('America/Los_Angeles', true);
>> c.isDST()
false
But when I use moment.tz(), I am getting the right value.
>> let c = moment.tz('2023-03-12 9:15 AM', 'YYYY-MM-DD HH:mm a', 'America/Los_Angeles');
>> c.isDST()
true
Why are they not equal? Which is the right way of doing it? Is there any other problem with the first approach that I should keep in mind while using it?