Return to Snippet

Revision: 50576
at August 26, 2011 21:12 by Wookkie


Initial Code
var date = new Date();
var d  = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
 
document.write(day + "/" + month + "/" + year);

Initial URL

                                

Initial Description

                                

Initial Title
edit Dateformat to yyyy-mm-dd

Initial Tags
date

Initial Language
JavaScript