I'm guessing there's a difference between my PHP time and the server time.
When I check the current time in PHP, it's showing that MST is being used. However, cron jobs aren't running at the correct time.
How can I check to see what timezone the server itself is using, not what PHP is set to use?
Best Answer
Cron job uses the server's define timezone (UTC by default) which you can check by typing the
date
command in terminal.All countries timezones are defined in
/usr/share/zoneinfo
directory:When you cd into this directory you will see the name of different countries and their timezone.
Command to change server timezone.
If you live in America > LA you can change your time-zone using above command. Change the country and state according to your requirement.
Command to check the date and time:
Set time and date from the command line: