Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
187
rated 0 times [  193] [ 6]  / answers: 1 / hits: 16933  / 15 Years ago, fri, april 17, 2009, 12:00:00

How can I convert one date format to another format in JavaScript?



Example:



the old format is




YYYY/MM/DD




but I want to convert it into




DD-MM-YYYY



More From » date

 Answers
111

I think you can use jQuery UI library's datepicker: use the parseDate method to convert a string to a Date object, and then formatDate to convert the Date object to another string. Check the samples provided on the site; they include format modifiers.


[#99691] Saturday, April 11, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
emiliano

Total Points: 381
Total Questions: 109
Total Answers: 93

Location: Jersey
Member since Fri, Oct 1, 2021
3 Years ago
emiliano questions
;