I have a string Mon Mar 28 00:00:00 EDT 2022 which I want to parse but it's not working
dateFns.parse(theDate, "eee MMM d HH:mm:ss X yyyy", null)
Getting
RangeError: The format string mustn't contain
eeeandMMMat the same time
Well, you can try this:
dateFns.parse(theDate, "EEE MMM d HH:mm:ss X yyyy", new Date())
but this still wrong, the "EDT" string cause error, I've tried with "-04" instead, it works. So maybe you should try some way convert the "EDT, UTC,.." string to timezone format "-04" "+07"