Results 1 to 4 of 4

Thread: Servers Based In USA, Im in UK, Time Difference?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2002
    Location
    Nottingham, United Kingdom
    Posts
    6

    Question Servers Based In USA, Im in UK, Time Difference?

    Hi there, my server is based in the use, and the server clock is 5 hours behind my preasent time. How can i make it so the time on my scripts is forward 5 hours??
    ================
    ClickMamba.com
    [email protected]

  2. #2
    scoutt
    Guest
    you could use mktime() and add 5 hours to it. something like

    PHP Code:
    $hr =  date("H");
    $min =  date("i");
    $sec date("s");

    $newtime strftime("%H:%i:%s"mktime($hr+5,$min,$sec,0,0,0)); 
    of course you can change the format if you want a different time, like change H to h if you want the time to only goto 12 instead of 23

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2002
    Location
    Nottingham, United Kingdom
    Posts
    6
    cheers mate
    ================
    ClickMamba.com
    [email protected]

  4. #4
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    The PHP function gmtime function will always return the date/time in GMT.

    During our summer you can add 1 to that, during winter leave the returned value as it is. I tend to just leave it as it is and always put "GMT" after the value so people know.

Posting Permissions

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



Click Here to Expand Forum to Full Width