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 8 of 8
  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts

    $date, wrong in my timezone...

    I have a simple date variable which I am e-mailing,
    PHP Code:
    $date date('d/m/Y'); 
    , but the date comes in a day behind, does it pull it off my server? Is it possible to make the date specific to my timezone... Which is Australia...

  • #2
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    If you do the time as well, how many hours behind is it?

    PHP Code:
     putenv("TZ=Australia/Sydney"); 
    Put that at the start of your script and it should be the right time
    Last edited by Mwnciau; 09-03-2007 at 09:35 AM.

  • #3
    Regular Coder
    Join Date
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Jeez I don't know the server is in LA and I'm in Sydney... It's 5.30pm on Monday here...

  • #4
    Regular Coder
    Join Date
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts
    What about if I do something like this:

    putenv("TZ=AU/Eastern");

  • #5
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    PHP Code:
    putenv("TZ=Australia/Sydney"); 

  • #6
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Hi,
    The way I do it is as below.

    $date = date('Ymd', strtotime('-15 hours'));

    Hope this helps Kyle

  • #7
    Regular Coder
    Join Date
    Mar 2006
    Posts
    459
    Thanks
    3
    Thanked 0 Times in 0 Posts
    But don't I need to have it AU/Eastern?

  • #8
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts


  •  

    Posting Permissions

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