Current location: Hot Scripts Forums » Programming Languages » PHP » set time zone and print day and date in PHP 4


set time zone and print day and date in PHP 4

Reply
  #1 (permalink)  
Old 11-04-07, 11:14 AM
crmpicco's Avatar
crmpicco crmpicco is offline
Wannabe Coder
 
Join Date: Jan 2005
Posts: 124
Thanks: 0
Thanked 0 Times in 0 Posts
Stop 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!

PHP Code:

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"); 
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
Reply With Quote
  #2 (permalink)  
Old 11-04-07, 12:09 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
The end of life of PHP4 is in less than two months. Your host will be forced to upgrade to PHP5 or get left behind. I would not put a lot of effort into making something work on PHP4.

You might want to check with your host. He might already have PHP5 in place and you only need to select it through your control panel or through a statement placed in a .htaccess file.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
  #3 (permalink)  
Old 11-04-07, 03:43 PM
crmpicco's Avatar
crmpicco crmpicco is offline
Wannabe Coder
 
Join Date: Jan 2005
Posts: 124
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Mab,

Thanks for that info. I have just put a support request into my host (Turtle Hosting) asking them if they are going to be upgrading to PHP 5.

I've justed checked the .htaccess file and there is no mention of the version of PHP that can be specified.

Don't see a thing in my Control Panel either :-(

Picco
Reply With Quote
  #4 (permalink)  
Old 11-04-07, 03:45 PM
crmpicco's Avatar
crmpicco crmpicco is offline
Wannabe Coder
 
Join Date: Jan 2005
Posts: 124
Thanks: 0
Thanked 0 Times in 0 Posts
when you had said that PHP4 is coming to the end of it's life - you don't actually mean that it will cease to function? If it is installed on Turtle Hosting's servers it would still work surely?

Although, my question is.......why are they still using PHP 4??? :-)

Also, is there a way to change the locale setting/time zone in PHP 4?

Picco
Reply With Quote
  #5 (permalink)  
Old 11-04-07, 03:50 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
http://www.php.net/index.php#2007-07-13-1

PHP 4 will not stop to function, just the support ends.
Reply With Quote
  #6 (permalink)  
Old 11-05-07, 02:55 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
I see through your posts in a different programming forum that you have php5 available and have probably switched over to it.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
  #7 (permalink)  
Old 11-05-07, 04:03 PM
crmpicco's Avatar
crmpicco crmpicco is offline
Wannabe Coder
 
Join Date: Jan 2005
Posts: 124
Thanks: 0
Thanked 0 Times in 0 Posts
yes, I have switched over to PHP 5. Thanks.

Just editted my .htaccess file.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
change timezone in PHP 4.3 dathandawg PHP 0 12-09-05 10:29 AM
perl dates (for rss feed) gnznroses Perl 4 11-28-05 01:44 PM


All times are GMT -5. The time now is 07:31 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.