Last active
January 26, 2017 13:38
-
-
Save belchior/f05183bb744696fe2c96 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
function now() { | |
var d = new Date().toLocaleString().match(/(\d{1,2})\/(\d{1,2})\/(\d{1,2}).*(\d{2}):(\d{2}):(\d{2})/); | |
return { | |
text: d[0], | |
day: parseInt(d[1]), | |
month: parseInt(d[2]), | |
year: parseInt(d[3]), | |
hour: parseInt(d[4]), | |
minute: parseInt(d[5]), | |
second: parseInt(d[6]) | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment