DEV Community

Sekti Wicaksono
Sekti Wicaksono

Posted on

Getting MonthName from new Date()

const today = new Date()

// Default
today.toLocaleString('default', { month: 'long' }) // February
today.toLocaleString('default', { month: 'short' }) // Feb

// Indonesia
today.toLocaleString('id-ID', { month: 'long' }) // Februari
today.toLocaleString('id-ID', { month: 'short' }) // Feb

// English - GB
today.toLocaleString('en-GB', { month: 'long' }) // February
today.toLocaleString('en-GB', { month: 'short' }) // Feb

// English - US
today.toLocaleString('en-US', { month: 'long' }) // February
today.toLocaleString('en-US', { month: 'short' }) // Feb
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more