Solved

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

Posted on 2014-11-14
4
96 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
execute script based on HTML event 7 22
Angular service to share objects between controllers 1 15
Javascript tutorials with real examples 5 25
Jquery keyup 4 17
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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…

813 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

11 Experts available now in Live!

Get 1:1 Help Now