I have always worked with dates in ISO format that ends with a 'Z'. But now I have to replace that 'Z' with timezone info like +08:00
.
In other words, currently I have this format 2020-01-17T00:30:00.000Z
, but now I need it in this format 2020-01-17T08:30:00+08:00
.
Looks like popular date library like moment
and dayjs
convert date to ISO format without 'Z' too by default. Is that still considered an 'ISO' date format? And I can't find out how to do it with vanilla Javascript and doing the .toISOString()
always gives me the 'Z'..