Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
55
rated 0 times [  57] [ 2]  / answers: 1 / hits: 33998  / 13 Years ago, mon, february 20, 2012, 12:00:00

so, i need format JSON date from this format



9/30/2010 12:00:00 AM, it is MM/DD/YYYY HH:MM:SS to format like this : DD/MM/YYYY, so i dont need info about hours, min and sec, and i need replace months and days from json, i tried some different ways but it always failed



i need do this using jQuery



also i didnt find any answer to formating this date type, all i found was formating date like this :/Date(1224043200000)/



so anyone have idea?


More From » jquery

 Answers
65

you can create a Date Object from a string like so:



var myDate = new Date(dateString);


then you can manipulate it anyway you want, one way to get your desired output is:



var output = myDate.getDate() + \ +  (myDate.getMonth()+1) + \ + myDate.getFullYear();


you can find more at this elated.com article working with dates


[#87332] Sunday, February 19, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
elijahm

Total Points: 674
Total Questions: 124
Total Answers: 79

Location: Northern Mariana Islands
Member since Fri, Jan 15, 2021
3 Years ago
;