Created
April 28, 2009 19:38
-
-
Save johnantoni/103345 to your computer and use it in GitHub Desktop.
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
function convertUKtoUSdate(ukDate) { | |
var tmpDate = ukDate; | |
if (tmpDate.indexOf(" ", 0) > 0) { | |
tmpDate = tmpDate.slice(0, tmpDate.indexOf(" ", 0) + 1); | |
} | |
var sl = tmpDate.length; | |
s1 = tmpDate.indexOf("/", 0); | |
var s2 = tmpDate.indexOf("/", s1 + 1); | |
var ukDate = tmpDate.slice(s1 + 1, s2) + "/" + tmpDate.slice(0, s1) + "/" + tmpDate.slice(s2 + 1, sl); | |
ukDate = new Date(ukDate); | |
return ukDate | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment