time zone setting after server move

Discussion in 'Troubleshooting' started by mikelinen, Aug 3, 2014.

  1. mikelinen

    mikelinen New Member

    Joined:
    Jun 22, 2011
    Messages:
    22
    Thought this might help other users.

    I moved where I host amember to a new server , and the system time changed by 8 hours. That caused the access logs to change, and the receipts my customers rcd on purchase were off by 8 hours. So clearly my timezone was off.

    I searched all over this forum and found about 4 different ways to fix this. The only one that worked is this:

    Create a custom php.ini file in your aMember folder and set the date.timezone value to one that is appropriate.

    example: date.timezone = "US/Central"

    That worked!

    In case you have never done that, just create a text file, call it php.ini
    in the text file, place one line of text as follows and save it to your amember folder (and upload it if working offline). That's it.

    date.timezone = "US/Central"
    or
    date.timezone = "US/Pacific"

    or as appropriate. Not sure where the complete list of these values is.
  2. mikelinen

    mikelinen New Member

    Joined:
    Jun 22, 2011
    Messages:
    22
    Hmmm. wait, this might not have worked. I'd left some of the other attempts in place, but then deleted them after this last one appeared to work, and now notice the system time went back to the wrong time. SO I added back in one of the earlier methods and that fixed the system time again.

    So I think the method that worked was to also place the same date.timezone line shown above in a file called .user.ini and save that file at the root directory of my webserver. That's what I have now (in addition to the php.ini above), and system time is correct. Not sure if you need both, but it's working for me so I am leaving both in place.
  3. microlinx

    microlinx Member

    Joined:
    Oct 26, 2004
    Messages:
    268
    This post should be made sticky! It's essential for anyone on a shared hosting account. I added both files and now the system time for amember is correct. Thanks!
  4. ccwjames

    ccwjames Member

    Joined:
    Sep 11, 2014
    Messages:
    430
    well i like to say i`m on godaddy thats 10 hours out of the uk and when i did some edits the time zone would never change. thats why i use a vps in Germany, 1 min job to change the time via command :)
  5. halmaclean

    halmaclean aMember Pro Customer

    Joined:
    Aug 30, 2013
    Messages:
    50
    Just to update this - aMember v6.2+

    Edit the /application/configs/config.php file to add in the following line:

    date_default_timezone_set('Your/Location');

Share This Page