ISO Date Format Examples

A date formatting JavaScript library that helps convert any date object into the shortest equivalent ISO 8601 UTC string.

Check out the console log

format(new Date(Date.UTC(2021, 3, 23, 12, 38)))
  => 2021-04-23T12:38Z
format(new Date(Date.UTC(2021, 3, 23)))
  => 2021-04-23
format(new Date(Date.UTC(2000, 0, 1, 12, 38)))
  => 2000-01-01T12:38Z
format(new Date(Date.UTC(2000, 11, 25, 12, 38)))
  => 2000-12-25T12:38Z