Page 1 of 1
Date in Dutch
Posted: Sat Mar 25, 2006 11:45 pm
by leon
Script URL:
http://www.kerkwest.nl/gb/gbook.php
Version of script: 1.35
Version of PHP:
Hosting company:
Have you searched THIS FORUM for your problem: yes
(if not please do before posting)
If so, what terms did you try: date dutch
Write your message below:
Hi,
is it possible to change the english name of the month into the dutch name? I think I have to change $added somewhere???
Thnx and regards,
Leon
Posted: Sun Mar 26, 2006 2:46 am
by Henrie
Hello Leon,
Yes it can be done.
It requires changing the gbook.php file at line 435
If the function setlocale is available on your hosting server you can edit the code to display local weekdays and months. Change the date code to this
Code: Select all
setlocale (LC_TIME, "Dutch");
$added=strftime ("%A %d %B %Y om %H:%M");
This is te code I use.
It is possible that you have to change
setlocale (LC_TIME, "Dutch"); to
setlocale (LC_TIME, "nl_NL"). I think it has to do with the OS of your host. I think with Windows you have to use "Dutch" and with Linux you have to use "nl_NL".
For information about the possible codes for the strftime function, look at this page
http://www.php.net/manual/en/function.strftime.php
or in dutch
http://www.php.net/manual/nl/function.strftime.php
If the setlocale function is not supported on your hosting server you can change the date to use all numbers, for example
Greetings,
Henrie
date in dutch
Posted: Sun Mar 26, 2006 9:33 pm
by leon
Thanks Henrie,
this works! However, only for new entries and not for those which were posted before changing the script. (?)
Groeten / regards !
Leon
Posted: Sun Mar 26, 2006 10:08 pm
by Henrie
That's because the entry is generated when it is written and is stored in the entries.txt file when it is submitted.
The pages that are being shown in the guestbook are just a presentation of the data in the entries.txt file.
It's not like the dates are being stored as a general date and you can choose how it is presented on screen. The date is shown exactly as it is stored in the entries.txt file.
The dates already present can be changed by editing the entries.txt file directly in a plain text editor.
Greetings / de Groeten,
Henrie
Date in dutch
Posted: Sun Mar 26, 2006 10:57 pm
by leon
Aha,
now I understand! Thnx Henrie !
