I am stuck in a weird situation and unfortunately,even after doing some RnD and googling, i am unable to solve this problem.
I have a date string in ISO format, lik
new Date(this.datePipe.transform(isoDate,'yyyy-MM-dd HH:mm:ss', 'UTC'));
Angular datepipe transform will convert it to a simple date time format as specified with no timezone. In case of ISO string format, the date constructor would have treated it as UTC time, but now, the Date constructor treats it as the local time.
Example in my case(IST):
input string: 2020-04-19T09:15:00.000Z
after transform this.datePipe.transform(input string)
2020-04-19 09:15:00
Date object
new Date(this.datePipe.transform(isoDate,'yyyy-MM-dd HH:mm:ss', 'UTC'));//treats the transformed date as local timezone date when creating the date object
Sun Apr 19 2020 09:15:00 GMT+0530 (India Standard Time)