Format a Date in UTC using a moment-style format string.
Supported tokens (each token is replaced once, in this order):
YYYY
MMM
MM
DD
ddd
HH
mm
ss
Any other tokens (e.g., YY, M, h, a) are NOT supported and will appear unchanged in the output.
YY
M
h
a
formatUTC(new Date('2024-03-15T14:30:00Z'), 'YYYY-MM-DD HH:mm:ss') // => '2024-03-15 14:30:00' Copy
formatUTC(new Date('2024-03-15T14:30:00Z'), 'YYYY-MM-DD HH:mm:ss') // => '2024-03-15 14:30:00'
Format a Date in UTC using a moment-style format string.
Supported tokens (each token is replaced once, in this order):
YYYY— 4-digit yearMMM— short month name (Jan, Feb, ...)MM— 2-digit month (01-12)DD— 2-digit day (01-31)ddd— short day name (Sun, Mon, ...)HH— 2-digit hour, 24-hour clock (00-23)mm— 2-digit minute (00-59)ss— 2-digit second (00-59)Any other tokens (e.g.,
YY,M,h,a) are NOT supported and will appear unchanged in the output.