Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder crmpicco's Avatar
    Join Date
    Jan 2005
    Location
    Mauchline, Scotland
    Posts
    1,093
    Thanks
    15
    Thanked 1 Time in 1 Post

    Cool 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

  • #2
    New Coder
    Join Date
    Jul 2005
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try this code. It is working with php 4.3.11
    PHP Code:
    setlocale (LC_ALL'de_DE@euro''de_DE''de''ge');
    echo 
    strftime("%A %e %B %Y"date('U')); 
    If you can not find a decision, maybe you have to try to change a problem

    http://www.gunman.co.nr
    http://bglinux.org


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •