For instance,
const d = new Date("2012-08-20T15:00:00-07:00");
d here is a UTC time with time offset = 07:00. Does it still require Z like this 2012-08-20T15:00:00-07:00Z? Is this correct?
If I take this string with Z and parse it using Date.parse() method in JavaScript, it throws an error. Not sure what is wrong!
No, you should not include the “Z” with a time zone offset.
From rfc3339:
The “Z” is a zero time offset, so including it with an explicit offset (especially a non-zero one) doesn’t makes sense.