Answers for "toLocaleDateString() options"

3

js toLocaleDateString options values

[[Weekday]]			"weekday"	"narrow", "short", "long"
[[Era]]				"era"	"narrow", "short", "long"
[[Year]]			"year"	"2-digit", "numeric"
[[Month]]			"month"	"2-digit", "numeric", "narrow", "short", "long"
[[Day]]				"day"	"2-digit", "numeric"
[[Hour]]			"hour"	"2-digit", "numeric"
[[Minute]]			"minute"	"2-digit", "numeric"
[[Second]]			"second"	"2-digit", "numeric"
[[TimeZoneName]]	"timeZoneName"	"short", "long"

/*

https://medium.com/swlh/use-tolocaledatestring-to-format-javascript-dates-2959108ea020
https://tc39.es/ecma402/#sec-datetimeformat-abstracts

*/
Posted by: Guest on December-30-2020
3

toLocaleDateString() options

new Date("1983-March-25").toLocaleDateString('fr-CA', { year: 'numeric', month: '2-digit', day: '2-digit' })
'03/25/1983'
Posted by: Guest on May-18-2020

Browse Popular Code Answers by Language