Skip to content

Instantly share code, notes, and snippets.

@emamut
Created April 8, 2014 20:04
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 emamut/10182701 to your computer and use it in GitHub Desktop.
Save emamut/10182701 to your computer and use it in GitHub Desktop.
get actual date
function get_actual_date () {
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth() + 1;
var yyyy = today.getFullYear();
if(dd < 10)
dd = '0' + dd
if(mm < 10)
mm='0'+mm
return yyyy + '-' + mm + '-' + dd;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment