Do Cron Jobs Follow the cPanel Account Time Zone?
When setting up scheduled tasks (cron jobs) in cPanel, it's important to understand how time zones affect execution. Many users assume that cron jobs will run according to the time zone set in their individual cPanel account or PHP scripts—but that's not the case.
Cron jobs on cPanel run based on the server’s system time, not the individual account’s configured time zone. This means that regardless of what time zone you use in your website scripts, cron jobs will follow whatever the hosting server’s time is set to.
If your server is running on UTC and you're in Eastern Time, you’ll need to adjust your cron schedule accordingly, typically subtracting 4 or 5 hours depending on daylight saving time.
How to Run Cron Jobs in a Specific Time Zone
To ensure a cron job runs in your preferred time zone, you can prepend the TZ
environment variable to the command like this:
TZ=America/New_York php /home/username/public_html/your-script.php
This won't change when the cron job runs, but it will affect how time is handled inside your script.
For full time zone listings, check: /usr/share/zoneinfo/
Understanding this distinction helps ensure your automated tasks run exactly when you expect them to, especially if you're working across time zones