admin管理员组文章数量:1026989
Is there any JavaScript library that takes Java's SimpleDateFormat
pattern and parses a date/time string into a Date
object?
For example, given "2010-12-20"
and "yyyy-MM-dd"
, the function would parse "2010-12-20"
and return a JavaScript Date
.
I noticed that jQuery UI's Date Picker can format and parse a date string, but it doesn't work with a time string.
Thanks.
Is there any JavaScript library that takes Java's SimpleDateFormat
pattern and parses a date/time string into a Date
object?
For example, given "2010-12-20"
and "yyyy-MM-dd"
, the function would parse "2010-12-20"
and return a JavaScript Date
.
I noticed that jQuery UI's Date Picker can format and parse a date string, but it doesn't work with a time string.
Thanks.
Share Improve this question edited Jan 23, 2011 at 0:00 Tom Tucker asked Jan 22, 2011 at 20:44 Tom TuckerTom Tucker 11.9k23 gold badges95 silver badges132 bronze badges 04 Answers
Reset to default 1This might be what you want: http://www.timdown.co.uk/code/simpledateformat.php
I would try the Datejs library: http://www.datejs./
I guess you are not the only looking for it. See this thread that has similar content. In the end, the author had to role his/her own but there are some good suggestions in there that might be of benefit.
Google's GWT project has a class to do this. http://google-web-toolkit.googlecode./svn/javadoc/1.5//google/gwt/i18n/client/DateTimeFormat.html Probably no small job to get that into a standalone javascript, though.
Is there any JavaScript library that takes Java's SimpleDateFormat
pattern and parses a date/time string into a Date
object?
For example, given "2010-12-20"
and "yyyy-MM-dd"
, the function would parse "2010-12-20"
and return a JavaScript Date
.
I noticed that jQuery UI's Date Picker can format and parse a date string, but it doesn't work with a time string.
Thanks.
Is there any JavaScript library that takes Java's SimpleDateFormat
pattern and parses a date/time string into a Date
object?
For example, given "2010-12-20"
and "yyyy-MM-dd"
, the function would parse "2010-12-20"
and return a JavaScript Date
.
I noticed that jQuery UI's Date Picker can format and parse a date string, but it doesn't work with a time string.
Thanks.
Share Improve this question edited Jan 23, 2011 at 0:00 Tom Tucker asked Jan 22, 2011 at 20:44 Tom TuckerTom Tucker 11.9k23 gold badges95 silver badges132 bronze badges 04 Answers
Reset to default 1This might be what you want: http://www.timdown.co.uk/code/simpledateformat.php
I would try the Datejs library: http://www.datejs./
I guess you are not the only looking for it. See this thread that has similar content. In the end, the author had to role his/her own but there are some good suggestions in there that might be of benefit.
Google's GWT project has a class to do this. http://google-web-toolkit.googlecode./svn/javadoc/1.5//google/gwt/i18n/client/DateTimeFormat.html Probably no small job to get that into a standalone javascript, though.
本文标签: Converting Java date string to JavaScript dateStack Overflow
版权声明:本文标题:Converting Java date string to JavaScript date - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745586034a2157601.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论