Convert Date Objects Into ISO 8601 UTC Strings – isoformat

Category: Date & Time , Javascript | April 23, 2021
Author:mbostock
Views Total:140 views
Official Page:Go to website
Last Update:April 23, 2021
License:MIT

Preview:

Convert Date Objects Into ISO 8601 UTC Strings – isoformat

Description:

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

How to use it:

1. Install and import the isoformat.

# NPM
$ npm i isoformat
import format from "isoformat";
<script type="module">
  import format from './src/index.js';
</script>

2. Usage.

const myValue = format(new Date(Date.UTC(2021, 3, 23, 12, 38)))
=> 2021-04-23T12:38Z

You Might Be Interested In:


Leave a Reply