Created
November 19, 2019 10:15
-
-
Save lvl99/af20ee34f0c6e3984b29e8f0f794a319 to your computer and use it in GitHub Desktop.
Date ISO string without timezone information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const controlDate = new Date(); | |
controlDate.toString(); | |
// -> "Thu Jun 20 2019 11:16:28 GMT+0200 (Central European Summer Time)" | |
controlDate.toDateString(); | |
// -> "Thu Jun 20 2019" | |
controlDate.toUTCString(); | |
// -> "Thu, 20 Jun 2019 09:15:28 GMT" | |
controlDate.toISOString(); | |
// -> "2019-06-20T09:16:28.244Z" | |
new Date(controlDate.toUTCString()).toISOString(); | |
// -> "2019-06-20T09:16:28.000Z" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment