admin管理员组文章数量:1289543
Is there a working jQuery plugin (or a javascript 'library') for formatting datetimes? I found some, but they were:
- not working with hours and minutes (the one from datapicker)
- not fully functional - can't give you names of months, leading zeroes, etc.
- are just a piece of code written in some blog.
Of course I can implement it, but it'd be better to reuse one. I seek functionality similar to Java's SimpleDateFormat
Is there a working jQuery plugin (or a javascript 'library') for formatting datetimes? I found some, but they were:
- not working with hours and minutes (the one from datapicker)
- not fully functional - can't give you names of months, leading zeroes, etc.
- are just a piece of code written in some blog.
Of course I can implement it, but it'd be better to reuse one. I seek functionality similar to Java's SimpleDateFormat
4 Answers
Reset to default 4I've written a JavaScript implementation of the format()
method of Java's SimpleDateFormat
: http://www.timdown.co.uk/code/simpledateformat.php
The code is a few years old and I'd do it a bit differently now, but it's well tested and works.
Did you try date.js ?
It has a pattern recognition to format dates that is easy to use and has plenty of localisation files available.
ie: Date.today().toString("d-MMM-yyyy HH:mm")
I use http://blog.stevenlevithan./archives/date-time-format
Not sure whether it fits all your requirements, but this looks good one:
- jquery-dateFormat
本文标签: javascriptjQuery datetime formatterStack Overflow
版权声明:本文标题:javascript - jQuery datetime formatter - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741478126a2381005.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论