I am trying to parse date using date-fns library for the first time (I removed moment.js and I will introduce date-fns in my project) but, when I use parse function, I get one day previous as result. I read in this topic
parse function in date-fns returns one day previous value
that problem is due to timezones but I could not be able to fix my problem because I receive dates in the format "yyyyMMdd". This is my code
var start ="20210119";
var stop ="20210130";
const dateFrom = parse(start, "yyyyMMdd", new Date());
console.log("date form",dateFrom);
Output of my console log is: 2021-01-18T23:00:00.000Z