Getting JavaScript Month from `new Date()` to Locale

const today = new Date() // 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

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.