Javascript - Date() method - toLocaleDateString()

You can change any of the options below (locales and options). The output box is live.

var date = new Date();
 
var locales = [  ]; E.g. en, en-gb, en-us, fr, de, ja, zh, ar-sa
 
var options = {
    localeMatcher : 
    timeZone : 
    hour12 : 
    hourCycle : 
    formatMatcher : 
    weekday : 
    era : 
    year : 
    month : 
    day : 
    hour : 
    minute : 
    second : 
    timeZoneName : 
}
 
console.log(date.toLocaleDateString( locales, options ));

Output

 
 
 


Ads by Google


Ask a question, send a comment, or report a problem - click here to contact me.

© Richard McGrath