开发者

Changing date format using javascript

开发者 https://www.devze.com 2023-01-07 07:51 出处:网络
i am getting date in the format (YY/DD/MM) for ex 2010/12开发者_StackOverflow中文版/07 i want to change format to Monday 7 July, 2010 through javascriptUse the toLocaleDateString() method of the date

i am getting date in the format (YY/DD/MM) for ex 2010/12开发者_StackOverflow中文版/07 i want to change format to Monday 7 July, 2010 through javascript


Use the toLocaleDateString() method of the date object (it will be specific to the user's locale)

var d = new Date('2010/12/07');
alert(d.toLocaleDateString());
0

精彩评论

暂无评论...
验证码 换一张
取 消