“Neues Date (). TolocaledateString Day” Code-Antworten

So erhalten Sie mit TolocaledateString Date

const date=new Date();
const options - {weekday:'long',year:'numeric',month:'long',day:'numeric'};
let today=today.toLocaleDatestring("en-IN",options);
ParthRangarajan

Neues Date (). TolocaledateString Day

//doc => https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString
//Works on Browser and nodejs

const event = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };

console.log(event.toLocaleDateString('de-DE', options));
// expected output (varies according to local timezone): Donnerstag, 20. Dezember 2012

console.log(event.toLocaleDateString('ar-EG', options));
// expected output (varies according to local timezone): الخميس، ٢٠ ديسمبر، ٢٠١٢

console.log(event.toLocaleDateString(undefined, options));
// expected output (varies according to local timezone and default locale): Thursday, December 20, 2012
Helpful Hedgehog

Ähnliche Antworten wie “Neues Date (). TolocaledateString Day”

Fragen ähnlich wie “Neues Date (). TolocaledateString Day”

Weitere verwandte Antworten zu “Neues Date (). TolocaledateString Day” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen