How do you display JavaScript datetime in 12 hour AM/PM format?

后端 未结 27 3070
慢半拍i
慢半拍i 2020-11-22 02:36

How do you display a JavaScript datetime object in the 12 hour format (AM/PM)?

27条回答
  •  旧巷少年郎
    2020-11-22 03:08

    Check out Datejs. Their built in formatters can do this: http://code.google.com/p/datejs/wiki/APIDocumentation#toString

    It's a really handy library, especially if you are planning on doing other things with date objects.

提交回复
热议问题