Setting timezone PST using PHP
Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Thread: Setting timezone PST using PHP

  1. #1
    http://computerzworld.com
    Join Date
    Jul 2008
    Posts
    196

    Setting timezone PST using PHP

    Hello,
    I want to set PST timezone using date_default_timezone_set(). What country I have to specify in the parameter in order to set PST timezone? Actually I want to get Facebook insights data & store it according to PST timezone as they are giving the data as PST timezone. Please help me. Thanks in advance.

    Computerzworld
    ╠► Explore the world of computers.

  2. #2
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,905
    Quote Originally Posted by computerzworld
    What country I have to specify in the parameter in order to set PST timezone?
    What country in the world uses a timezone called "PST"? (Though the argument to date_default_timezone_set is usually a combination of a continent and a city, not a country).
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  3. #3
    http://computerzworld.com
    Join Date
    Jul 2008
    Posts
    196
    Yes, I need continent & city that uses PST timezone. Thanks.

    Computerzworld
    ╠► Explore the world of computers.

  4. #4
    Pna lbh ernq guvf¿
    Join Date
    Jul 2004
    Location
    Kansas City area
    Posts
    19,432
    See the timezones section of the PHP manual - it lists every possible value.

  5. #5
    http://computerzworld.com
    Join Date
    Jul 2008
    Posts
    196
    Ya I checked it but I was not sure which timezone to use for PST? Thanks.

    Computerzworld
    ╠► Explore the world of computers.

  6. #6
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,905
    Well, why do you need to use PST as opposed to, say, AWST? Is it something to do with the geographical location of your target audience (e.g., they're all in Pakistan)?

    Presumably you have some sort of geographical constraint that is causing you to need a particular timezone. Otherwise you'd might as well just use Universal Time.
    Last edited by Weedpacket; 03-26-2012 at 11:01 PM.
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  7. #7
    Senior Member
    Join Date
    Mar 2009
    Posts
    812
    Quote Originally Posted by Weedpacket View Post
    What country in the world uses a timezone called "PST"?
    The United States and Canada. PST is Pacific Standard Time.
    Declare variables, not war.

  8. #8
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    13,974
    America/Los_Angeles should to the job.
    Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett

    "But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because he’s a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html


    eBookworm.us

  9. #9
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,905
    Quote Originally Posted by NogDog
    America/Los_Angeles should to the job.
    Yes, but I was hoping computerzworld would look at the list and see it. For that to have failed would have required not knowing where Los Angeles is. Even then, a Google search for "PST timezone" would have located the city in the first two or three hits.
    Last edited by Weedpacket; 03-25-2012 at 12:38 AM.
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  10. #10
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,905
    Quote Originally Posted by Bonesnap View Post
    The United States and Canada. PST is Pacific Standard Time.
    Or Pakistan Standard Time; besides, I wasn't asking you
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  11. #11
    Senior Member
    Join Date
    Mar 2009
    Posts
    812
    Quote Originally Posted by Weedpacket View Post
    Or Pakistan Standard Time; besides, I wasn't asking you
    Pakistan Standard Time is PKT.

    Declare variables, not war.

  12. #12
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,905
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  13. #13
    Senior Member Derokorian's Avatar
    Join Date
    Apr 2011
    Location
    Denver
    Posts
    1,787
    Hence PHP doesn't accept those acronyms as time zones - they are ambiguous.
    Sadly, nobody codes for anyone on this forum. People taste your dishes and tell you what is missing, but they don't cook for you. ~anoopmail
    I'd rather be a comma, then a full stop.
    User Authentication in PHP with MySQLi - Don't forget to mark threads resolved - MySQL(i) warning

  14. #14
    Senior Member
    Join Date
    Mar 2009
    Posts
    812
    Quote Originally Posted by Weedpacket View Post
    A Google search for "PST" will result in "Pacific Standard Time" results. A Google search for "PKT" results in Pakistan Standard Time.

    Also, http://www.timeanddate.com/library/a.../asia/pkt.html
    http://www.worldtimezone.com/wtz-names/wtz-pkt.html
    http://en.wikipedia.org/wiki/Pakistan_Standard_Time
    http://wwp.greenwichmeantime.com/tim...asia/pakistan/ (only mentions PST as Pacific Standard Time)

    Pakistan doesn't observe daylight saving time but North America does hence we have PST and PDT.

    As for the Philippines they're PHT.
    Declare variables, not war.

  15. #15
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,905
    I concede: Wikipedia and Google are much better authorities on what the timezones for Pakistan and the Philippines are called than the Pakistani or Filipino governments.
    Last edited by Weedpacket; 03-26-2012 at 11:02 PM.
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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