Solved

Date on my website in US-format. How to change it to NL-format.

Posted on 2014-11-14
4
91 Views
Last Modified: 2014-11-14
Hi,

I have a date on my website and the date is generated by a java-script. The date is displayed as f.e.:
Friday, November 14, 2014 and that's the US-notation. It should be:
Vrijdag 14 november 2014. How can I changed that?

// START DATE SCRIPT

   if (showdate == "yes") {

document.write('<div id="date-location">');
var d=new Date();
var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
document.write("<span class=\"date-font\"><nobr>" + weekday[d.getDay()] + ", ");

document.write(monthname[d.getMonth()] + " ");

document.write(d.getDate() + ", ");

document.write(d.getFullYear());
document.write("</nobr><br></span>");
document.write('</div>');
}
else {
document.write('&nbsp;<br>');
}

Open in new window


Greetings, Peter Kiers
0
Comment
Question by:peterkiers
  • 2
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Brian Tao
Comment Utility
Just change the content of the array in line 7 and 8 to the language you want to use.  Something like:
var weekday=new Array("zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag");
var monthname=new Array("januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december");

Open in new window

and then it should work.
0
 
LVL 1

Author Comment

by:peterkiers
Comment Utility
Oke that I knew but forgot to mention but how can I change the format from:
Friday, November 14, 2014  to
 Vrijdag 14 november 2014.

How can I changed that?

Peter
0
 
LVL 9

Accepted Solution

by:
Brian Tao earned 500 total points
Comment Utility
Oh, so you want to change the display sequence and don't want the commas.  Then this should work:
// START DATE SCRIPT

   if (showdate == "yes") {

document.write('<div id="date-location">');
var d=new Date();
var weekday=new Array("zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag");
var monthname=new Array("januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december");document.write("<span class=\"date-font\"><nobr>" + weekday[d.getDay()] + " ");
document.write(d.getDate() + " ");
document.write(monthname[d.getMonth()] + " ");
document.write(d.getFullYear());
document.write("</nobr><br></span>");
document.write('</div>');
}
else {
document.write('&nbsp;<br>');
}

Open in new window

0
 
LVL 1

Author Comment

by:peterkiers
Comment Utility
Thanks peter Kiers
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now