Skip to content

Instantly share code, notes, and snippets.

@belchior
Last active January 26, 2017 13:38
Show Gist options
  • Save belchior/f05183bb744696fe2c96 to your computer and use it in GitHub Desktop.
Save belchior/f05183bb744696fe2c96 to your computer and use it in GitHub Desktop.
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