Solved

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

Posted on 2014-11-14
4
95 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
ID: 40442930
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
ID: 40442942
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
ID: 40443004
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
ID: 40443010
Thanks peter Kiers
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

911 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

23 Experts available now in Live!

Get 1:1 Help Now