Created
April 20, 2014 22:07
-
-
Save Crystalh/11126460 to your computer and use it in GitHub Desktop.
Javascript: Unexpected Date object method output - toISOString()
This file contains hidden or 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
var localDateStr = new Date('02.04.2014').toLocaleDateString('en-GB'); //4/2/2014 | |
var test = new Date(dateStr).toISOString(); //2014-04-01T23:00:00.000Z | |
EXPECTED RESULT: | |
2014-04-02T00:00:00.000Z | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment