How do you display a JavaScript datetime object in the 12 hour format (AM/PM)?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
use
dateObj.toLocaleString([locales[, options]])
Option 1 - Using locales
Option 2 - Using options
Note: supported on all browsers but safari atm