<!DOCTYPE html>
<html>
<body>
<h2>The Date I get from the DatePicker displays as : 17-06-2022</h2>
<p>
I need it to display as (In Danish) : Fredag d. 17 Juni 2022
(In English) : Friday 17th June 2022</p>
<p id="demo"></p>
<p>Fredag d. 17 Juni 2022 [17-06-2022]<p/>
</body>
</html>
JavaScript
const birthday = new Date('2022 06 17');
options = {
year: 'numeric',
month: 'long',
day: 'numeric',
weekday: 'long',
};
var text = birthday.toLocaleDateString('da-DK', options);
document.getElementById("demo").innerHTML = text;
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.