Created
December 17, 2017 09:54
-
-
Save biaocy/737a65dd2aab374cabd20ef8ffebdfd6 to your computer and use it in GitHub Desktop.
javascript normalize date time
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
//from https://stackoverflow.com/a/11172083 | |
var date = new Date(); | |
date.setMinutes(date.getMinutes() - date.getTimezoneOffset()); | |
date.toJSON(); //2017-12-17T17:51:45.055Z |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment