Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to get date using tolocaledatestring

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

new 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
Comment

Date toLocaleDateString Javascript

ar-SA: ٢٦‏/١‏/١٤٤٣ هـ في ٥:٥٦:٥٨ م
bn-BD: ৩/৯/২০২১ ৫:৫৬:৫৮ PM
bn-IN: ৩/৯/২০২১ ৫:৫৬:৫৮ PM
cs-CZ: 3. 9. 2021 17:56:58
da-DK: 3.9.2021 17.56.58
de-AT: 3.9.2021, 17:56:58
de-CH: 3.9.2021, 17:56:58
de-DE: 3.9.2021, 17:56:58
el-GR: 3/9/2021, 5:56:58 μ.μ.
en-AU: 03/09/2021, 5:56:58 pm
en-CA: 2021-09-03, 5:56:58 p.m.
en-GB: 03/09/2021, 17:56:58
en-IE: 3/9/2021, 17:56:58
en-IN: 3/9/2021, 5:56:58 pm
en-NZ: 3/09/2021, 5:56:58 pm
en-US: 9/3/2021, 5:56:58 PM
en-ZA: 2021/09/03, 17:56:58
es-AR: 3/9/2021 17:56:58
es-CL: 03-09-2021 17:56:58
es-CO: 3/9/2021, 5:56:58 p. m.
es-ES: 3/9/2021 17:56:58
es-MX: 3/9/2021 17:56:58
es-US: 3/9/2021 5:56:58 p. m.
fi-FI: 3.9.2021 klo 17.56.58
fr-BE: 03/09/2021, 17:56:58
fr-CA: 2021-09-03, 17 h 56 min 58 s
fr-CH: 03.09.2021, 17:56:58
fr-FR: 03/09/2021, 17:56:58
he-IL: 3.9.2021, 17:56:58
hi-IN: 3/9/2021, 5:56:58 pm
hu-HU: 2021. 09. 03. 17:56:58
id-ID: 3/9/2021 17.56.58
it-CH: 3/9/2021, 17:56:58
it-IT: 3/9/2021, 17:56:58
ja-JP: 2021/9/3 17:56:58
ko-KR: 2021. 9. 3. 오후 5:56:58
nl-BE: 3/9/2021 17:56:58
nl-NL: 3-9-2021 17:56:58
no-NO: 3.9.2021, 17:56:58
pl-PL: 3.09.2021, 17:56:58
pt-BR: 03/09/2021 17:56:58
pt-PT: 03/09/2021, 17:56:58
ro-RO: 03.09.2021, 17:56:58
ru-RU: 03.09.2021, 17:56:58
sk-SK: 3. 9. 2021, 17:56:58
sv-SE: 2021-09-03 17:56:58
ta-IN: 3/9/2021, பிற்பகல் 5:56:58
ta-LK: 3/9/2021, 17:56:58
th-TH: 3/9/2564 17:56:58
tr-TR: 03.09.2021 17:56:58
zh-CN: 2021/9/3 下午5:56:58
zh-HK: 3/9/2021 下午5:56:58
zh-TW: 2021/9/3 下午5:56:58
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery addeventlistener 
Javascript :: how to use compare password in node js 
Javascript :: install react app 
Javascript :: js sum of array 
Javascript :: jquery checkbox 
Javascript :: react date picker disable past dates 
Javascript :: javascript length 
Javascript :: material ui jss media query 
Javascript :: react deep copy 
Javascript :: splidejs pauseOnHover 
Javascript :: set background opacity react native 
Javascript :: convert map to object/JSON javascript 
Javascript :: sum of numbers array using for loop in javascript 
Javascript :: how to delete a variable in js 
Javascript :: bottom tab navigator react native transparent 
Javascript :: How to Loop Through an Array with a for…in Loop in JavaScript 
Javascript :: remove first and last character javascript 
Javascript :: webpack set mode to development 
Javascript :: how to generate random string in javascript 
Javascript :: how to check if browser tab is active javascript 
Javascript :: encodeuri hashtag 
Javascript :: javascript template string examples 
Javascript :: remove element from dictionary javascript 
Javascript :: how to fetch api in reactjs using axios 
Javascript :: js array find string element with max length 
Javascript :: get data from url javascript 
Javascript :: react form reload page 
Javascript :: smooth scroll to target with offset 
Javascript :: js inline if 
Javascript :: flutter http request 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =