79624495

Date: 2025-05-16 04:55:03
Score: 1
Natty:
Report link

May depend on your locale but I found if dayPeriod is omitted all-together then it outputs "AM" or "PM".

new Intl.DateTimeFormat('en', {
  hourCycle: 'h12',
  hour: "2-digit",
  minute: "2-digit",
}).format(new Date())
// => "12:48 AM" 
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Eccentric J