/    Sign up×
Community /Pin to ProfileBookmark

set time zone and print day and date in PHP 4

Hi,

Can anyone tell me how to set the local time zone and write it out in this format in PHP 4 (my server is using PHP 4.4.4).

I have PHP 5 on my local machine and was originally using the following code, which worked fine!

[code=php]
date_default_timezone_set(‘Europe/Berlin’);
// Set the gloabal LC_TIME constant to german for the purpose of the date
setlocale(LC_ALL, “de_DE”, “de_DE@euro”, “deu”, “deu_deu”, “german”);
[/code]

However, it is not supported in PHP 4.

I’ve looked in “putenv”, but it does not change the day value, i.e. from Sunday to Sonntag.

English Version: Sunday, 04. November 2007
German Version: Sonntag, 04. November 2007

Any help is much appreiated,
Picco
?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NogDogNov 04.2007 — You might be able to use [url=http://www.php.net/setlocale]setlocale[/url]() to handle the day naming.
Copy linkTweet thisAlerts:
@crmpiccoauthorNov 04.2007 — Thanks, was there no way to do this in PHP 4? Seems strange, also seems like something that people would do regularly. I've also been told that PHP 4 ends in a month or so?

I've dropped a support ticket into my host to see if they are upgrading to PHP 5.
Copy linkTweet thisAlerts:
@NogDogNov 05.2007 — Go to www.php.net and scroll down just a bit, and you will see the "PHP 4 end of life announcement".
Copy linkTweet thisAlerts:
@crmpiccoauthorNov 09.2007 — Cool, thanks. 31st December this year is time up for PHP 4 :-)
×

Success!

Help @crmpicco spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...