I was wondering if anyone could help me get the leading zero to show up when I do a getDate? Right now it’s showing up as 8/3/2010 … I would like it 08/03/2010.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to detect if the value of the day and month is less than 10 and add the zero yourself:
You can see it in action here. Note that you add one to the month as January = 0 rather than 1.