I want to know how to use the Date() function in jQuery to get the current date in a yyyy/mm/dd format.
I want to know how to use the Date() function in jQuery to get
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.
Date()is not part ofjQuery, it is one of JavaScript’s features.See the documentation on Date object.
You can do it like that:
See this jsfiddle for a proof.
The code may look like a complex one, because it must deal with months & days being represented by numbers less than
10(meaning the strings will have one char instead of two). See this jsfiddle for comparison.