SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Time Settings

  1. #1
    SitePoint Addict
    Join Date
    Mar 2008
    Location
    Sterling, CO
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Time Settings

    Hi,

    I have this in my php.ini:

    date.timezone = "America/Kentucky/Louisville"

    When I echo: echo date("Y-m-d H:i:s");

    I get: 2012-10-19 09:46:12

    But my real time is: 2012-10-19 05:46:12

    How come it's not correct??

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    What date/time does the server think it is?

    How many php.ini files are there on that machine?

    Are you using CLI PHP at all?

  3. #3
    SitePoint Addict
    Join Date
    Mar 2008
    Location
    Sterling, CO
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure. I know at least two but one I never mess with because the "main" one I think overides it.

    I put this at the top of my page: date_default_timezone_set('America/Kentucky/Louisville');
    and that fixed the time (at least for that page.

    I think what I need to do is set the time in .htaccess because that way it will be set when I move to a real server.


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
  •