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.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
cPanel Question
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
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.
cPanel will be taking the time from the server, which only BuyShared can set.
The PHP timezone will only work on webpages/applications.
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
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.
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).
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.