SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Time Zone

  1. #1
    SitePoint Member
    Join Date
    Jul 2003
    Location
    Behind you.
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Time Zone

    My webhost has all the servers in hong kong --- anyways the andministrators cant change the timezone. is there a way to change the date() function to subtract 12 hours to get to eastern time. I want my webpage to change designs depending on what day it is. Such as monday gets one, tuesday gets one, etc..

  2. #2
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use the date() function like so:
    PHP Code:
    $date date("D"time() - (12 60 60)); 
    "D" is equal to the three letter representation of the day of the week. ie, "Thu" for Thursday"

    Use "l" (lowercase "L" ) for the full day name.

    Read the PHP manual under "date" for more settings.

    HTH
    John

  3. #3
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    There are actually a bunch of examples of adjusting for time zone people wrote in the comments at php.net under the time/date functions.


Bookmarks

Posting Permissions

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