Created
January 12, 2015 06:22
-
-
Save JayMc/8b7621cfb900ac9dc711 to your computer and use it in GitHub Desktop.
normal date to ISODate
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 todayUTC = new Date('25 July 2015 8:00 UTC'); | |
var todayMel = new Date('25 July 2015 8:00 +10'); //illegal use!? | |
console.log(todayUTC.toISOString()); | |
console.log(todayMel.toISOString()); | |
console.log(todayUTC.toLocaleString('en-AU')) | |
console.log(todayMel.toLocaleString('en-AU')) | |
*/ | |
var isoDate1 = new Date('26 July 2015 14:00').toISOString(); | |
console.log(isoDate1) | |
var isoDate2 = new Date('26 July 2015 14:00').toISOString(); | |
console.log(isoDate2) | |
//http://www.timeanddate.com/worldclock/converted.html?iso=20150725T08&p1=152&p2=0 | |
//http://stackoverflow.com/questions/948532/how-do-you-convert-a-javascript-date-to-utc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://jsfiddle.net/jqg797dr/