Date#strftime var date = new Date(2011, 5, 29); date.strftime("%Y-%m-%d"); "2011-06-29" Problems ahead var date = new Date(2009, 11, 5); date.strftime("%Y"); //=> "2009" date.strftime("%m"); //=> "12" date.strftime("%d"); //=> "05" date.strftime("%y"); //=> "9" Test setup <!DOCTYPE html> <html> <head> <title>Date.prototype.strftime test</title> </head> <body> <script type="text/javascript" src="st