parseDate giving "invalid format" error
Hi,
I have two date values in String format like "2024-07-25 19:41:27.0000000 +00:00"
I want to calculate the time difference in between so I want to change them to date format. so used the code below but it gives me the invalid format error. Parsing neglects the year:
let StartDate = "2024-07-25 19:41:27.0000000 +00:00"
let sdf = "yyyyMMddHHmmsszzz";
result = parseDate(StartDate,sdf);
Invalid format: "2024-07-25 19:41:27.0000000 +00:00" is malformed at "-07-25 19:41:27.0000000 +00:00"
I even tried the slice the string, but I got the same error:
let StartDate = "2024-07-25 19:41:27.0000000 +00:00"
let ShortStartDate = StartDate.slice(0,19)
let sdf = "yyyyMMddHHmmsszzz";
result = parseDate(ShortStartDate,sdf);
Invalid format: "2024-07-25 19:41:27" is malformed at "-07-25 19:41:27"

