S
Sune
How do I allways get day with two digits, not
var dd = d.getDate();
if (dd <10) dd = '0' + dd;
var dd = d.getDate();
if (dd <10) dd = '0' + dd;
In comp.lang.javascript message said:Sune said the following on 8/31/2007 2:54 PM:
The day will be returned as a number. The only way to get the leading
zero is to convert it to String and add it yourself as you are doing.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.