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
Date in Dutch
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 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
Yes it can be done.
It requires changing the gbook.php file at line 435
Code: Select all
$added=date ("F j, Y");
Code: Select all
setlocale (LC_TIME, "Dutch");
$added=strftime ("%A %d %B %Y om %H:%M");
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
Code: Select all
$added=date ("d-m-Y");
Henrie
date in dutch
Thanks Henrie,
this works! However, only for new entries and not for those which were posted before changing the script. (?)
Groeten / regards !
Leon
this works! However, only for new entries and not for those which were posted before changing the script. (?)
Groeten / regards !
Leon
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
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
Aha,
now I understand! Thnx Henrie !
now I understand! Thnx Henrie !
