Skip to content

Instantly share code, notes, and snippets.

@kyo-ago
Created July 20, 2010 02:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyo-ago/482393 to your computer and use it in GitHub Desktop.
Save kyo-ago/482393 to your computer and use it in GitHub Desktop.
日付を固定長に変換
function YYYYMMDD (d) { return [d.getFullYear(), '0' + (d.getMonth() + 1), '0' + d.getDate()].join('-').replace(/-\d(\d\d)/g, '-$1'); };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment