date_default_timezone_set() returns a 4-hour late time

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Charles

    date_default_timezone_set() returns a 4-hour late time

    I live in Brazil so I used the following script to return time:

    <?
    date_default_ti mezone_set('Ame rica/Sao_Paulo');
    echo date('h:i:s');
    ?>

    But it returns 7:30 while it's actually 11:30 here. I checked the
    server time, and it is correct on the server. How could I return the
    time of São Paulo? Thanks.

  • Gordon Burditt

    #2
    Re: date_default_ti mezone_set() returns a 4-hour late time

    >I live in Brazil so I used the following script to return time:
    >
    ><?
    >date_default_t imezone_set('Am erica/Sao_Paulo');
    >echo date('h:i:s');
    >?>
    >
    >But it returns 7:30 while it's actually 11:30 here. I checked the
    >server time, and it is correct on the server. How could I return the
    >time of São Paulo? Thanks.
    Is the TIME ZONE set correctly on the server?

    Comment

    • Charles

      #3
      Re: date_default_ti mezone_set() returns a 4-hour late time

      On May 29, 9:26 pm, gordonb.du...@b urditt.org (Gordon Burditt) wrote:
      Is the TIME ZONE set correctly on the server?
      Yes it is. It's set to America/Sao_Paulo.

      Comment

      Working...