I have two dates:
var first = '21-11-2012';
var second = '03-11-2012';
What is the best way to format it like this:
var first = '2012-11-21';
var second = '2012-11-03';
Should I use jQuery or simply JavaScript?
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 don’t need jQuery for this, simply use JavaScript like so:
Although if you want more reusable code consider using the JavaScript Date Object.