Solved

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

Posted on 2014-11-14
4
98 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to change the colour of columns using dynamic data for google charts 3 50
Wordpress and Wufoo 1 40
Date on a table 16 37
Hta File displays dynamic File names 4 50
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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

730 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