Skip to content

Instantly share code, notes, and snippets.

@cyio
Created April 12, 2018 09:21
Show Gist options
  • Save cyio/2691b08d8ec71f018344ab0530a92726 to your computer and use it in GitHub Desktop.
Save cyio/2691b08d8ec71f018344ab0530a92726 to your computer and use it in GitHub Desktop.
parse date
const [all, year, month, day] = /([0-9]*)\-([0-9]*)\-([0-9]*)/.exec('2018-04-03')
console.log(all, year, month, day)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment