Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


cPanel Question
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

cPanel Question

xaitmixaitmi Member
edited March 2016 in Help

Hi.

So I have a BuyShared reseller.

Basically right now it's 12:58pm where I live.

But in my FTP client or cPanel File Manager when I modify a file it says 9:58AM so basically the server is probably 3 hours behind me.

But I went to SELECT PHP Version, and then config and then changed the Timezone to my timezone (America/New_York)

http://i.imgur.com/wNq5O2n.png

Then I made a php file to test

<?php
echo "The time is " . date("h:i:sa");
?>

And it displayed the correct time (my time).

But in my FTP client / cPanel File Manager still has the old times.

Even when I make a new file or edit a file it still shows the "old" time.

How can I fix this.

Comments

  • LicensecartLicensecart Member
    edited March 2016

    Your talking about cPanel and your server date but you are checking the PHP date?

    If you are looking for the server date you put this into SSH: date

    If you want to check PHP date you can set it in PHP.ini or overwrite it with the following in the PHP Code:

    date_default_timezone_set('Europe/London'); and change it what you want ABOVE the echo date();.

    Thanked by 1raindog308
  • @Licensecart said:
    Your talking about cPanel and your server date but you are checking the PHP date?

    If you are looking for the server date you put this into SSH: date

    If you want to check PHP date you can set it in PHP.ini or overwrite it with the following in the PHP Code:

    date_default_timezone_set('Europe/London'); and change it what you want ABOVE the echo date();.

    I don't have SSH this is a cPanel Reseller.

  • IshaqIshaq Member

    cPanel will be taking the time from the server, which only BuyShared can set.

    The PHP timezone will only work on webpages/applications.

    Thanked by 1HyperSpeed
  • Like mentioned you'll only get the effect of America/New_York on webpages and PHP because cPanel uses the servers date and time rather than your local machine or what your website sets - unfortunately

  • raindog308raindog308 Administrator, Veteran

    HyperSpeed said: unfortunately

    It has to have some time. What else would it use?

    If you want GMT, then server could be set to GMT, but that's not really a different experience.

    xaitmi said: I don't have SSH this is a cPanel Reseller.

    I have ssh on my buyshared cPanel reseller account and so do you.

    I think @Licensecart answered your question. If you're asking "how can I change the timestamps on files" then the answer is either (1) why do you care, or (2) man touch (which isn't a sexual suggestion but rather that you refer to the manual page of the touch command...but I don't recall if non-root users can modify timestamps).

  • DewlanceVPSDewlanceVPS Member, Patron Provider
    edited March 2016

    You can set your own custom time by using php code, I am not a programmer but there is many simple script which use your server time and you can add or subtract time.




    Did you try to use php.ini type trick?

  • Php and server time is different. You can set time zone in php.ini to work with any php script yet you need to use ssh and change the time zone in your server to update ftp and such services timezone to yours.

Sign In or Register to comment.