www.webdeveloper.com
Results 1 to 9 of 9

Thread: [RESOLVED] Better Way of Setting the Date?

  1. #1
    Join Date
    Dec 2007
    Location
    Mississippi
    Posts
    1,063

    resolved [RESOLVED] Better Way of Setting the Date?

    I live in the U.S. Central Standard Timezone, so naturally, my website follows CST. In one of my scripts, I use this:

    PHP Code:
    date_default_timezone_set('US/Central'); 
    to set the date accordingly before I insert it into my database. However, on this page from php.net, it warns PHP users not to use any of those timezones except for UTC.

    Is there a better way I can set the timezone to U.S. CST before I insert it into my database?

  2. #2
    Join Date
    Nov 2008
    Posts
    2,477
    Use whichever one fits best from this page.

  3. #3
    Join Date
    Dec 2007
    Location
    Mississippi
    Posts
    1,063
    I've looked at that list before, but I don't have any idea which one of those is equal to CST

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,634
    "America/Chicago" should be fine for CST (CDT starting this Sunday!).
    "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."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Dec 2007
    Location
    Mississippi
    Posts
    1,063
    Quote Originally Posted by nogdog View Post
    "america/chicago" should be fine for cst (cdt starting this sunday!).
    cdt?

  6. #6
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,634
    Daylight savings time starts the 2nd Sunday of March these days. So Central Standard Time will become Central Daylight Time this Sunday.
    "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."
    ~ Terry Pratchett in Nation

    eBookworm.us

  7. #7
    Join Date
    Dec 2007
    Location
    Mississippi
    Posts
    1,063
    Ah, okay. Sorry; I've just never heard the term CDT before.

  8. #8
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,634
    EST -> EDT
    CST -> CDT
    MST -> MDT (Except in Arizona, which is MST all year long)
    PST -> PDT
    "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."
    ~ Terry Pratchett in Nation

    eBookworm.us

  9. #9
    Join Date
    Dec 2007
    Location
    Mississippi
    Posts
    1,063
    Thanks Parents should never knock time spent on message boards; you learn so much from them

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
  •  
HTML5 Development Center



Recent Articles