开发者

How to format date

开发者 https://www.devze.com 2023-03-27 02:01 出处:网络
I have a date as \"Thursday, 4 Aug 2开发者_StackOverflow011\".How do I format it to \"yyyy/MM/dd\"?I have tried the codes:

I have a date as "Thursday, 4 Aug 2开发者_StackOverflow011". How do I format it to "yyyy/MM/dd"? I have tried the codes:

var myDate =   dateText.toString("yyyy/MM/dd");
myDate = Date.parseExact(myDate, "yyyy/MM/dd")

but none seem to work. Help please.


you may use datejs


here is a post on the subject : http://blog.stevenlevithan.com/archives/date-time-format

you also have this jquery plugin : http://plugins.jquery.com/project/jquery-dateFormat

0

精彩评论

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