🔵 🔵 🔵


Primary

၊၊||၊|။

moment().format() ⚬|Documentation|1st|20251021201101-00-⌔

Moment.js#displaying#format | Docs

Format 1.0.0+

moment().format();
moment().format(String);

This is the most robust display option. It takes a string of tokens and replaces them with their corresponding values.

moment().format();                                // "2014-09-08T08:02:17-05:00" (ISO 8601, no fractional seconds)
moment().format("dddd, MMMM Do YYYY, h:mm:ss a"); // "Sunday, February 14th 2010, 3:25:50 pm"
moment().format("ddd, hA");                       // "Sun, 3PM"
moment().format("[Today is] dddd");               // "Today is Sunday"
moment('gibberish').format('YYYY MM DD');         // "Invalid date"

📊 ➺

X was added in 2.0.0.

e E gg gggg GG GGGG were added in 2.1.0.

x was added in 2.8.4.

SSSS to SSSSSSSSS were added in 2.10.5. They display 3 significant digits and the rest is filled with zeros.

k and kk were added in 2.13.0.

Printed 2026-06-28.

(echo:: @ )

Link to original

Secondary

• • •