Created
October 11, 2009 01:38
-
-
Save imlucas/207313 to your computer and use it in GitHub Desktop.
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
| // SAT, DAY MONTH YEAR TIME OFF | |
| // (\w{3}+)(\,+) (\d{2}+) (\w{3}+) (\d{2}+) (\d{2}:\d{2}:\d{2}+) (\+|\-+)(\d{4}+) | |
| // Comes in like this | |
| // Sat, 10 Oct 09 00:43:06 +0000 | |
| // Needs to be | |
| // Sat Oct 10 00:43:06 GMT+0000 2009 | |
| var cleaned:String = String(created).replace(/(\w{3}+)(.{1}+) (\d{2}+) (\w{3}+) (\d{2}+) (\d{2}:\d{2}:\d{2}+) (\+|\-+)(\d{4}+)/g, "$1 $4 $3 $6 GMT$7$8 20$5"); | |
| var then:Date = new Date(); | |
| then.setTime(Date.parse(cleaned)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment