Linux, Web Server & Database
Configure Server Timezone
Set your server's system timezone correctly so logs, cron jobs and timestamps make sense.
The Problem
Your server's clock is set to UTC or the wrong region's timezone, making log timestamps, scheduled tasks and application-level dates confusing or outright wrong for your actual location or audience.
About this problem
Most cloud VPS images default to UTC, which is sensible for consistency across distributed systems but quickly becomes confusing when you're manually reading logs, scheduling cron jobs for specific local times, or your application displays timestamps directly to users in the wrong timezone.
This typically comes up right after provisioning a new server, or when cron jobs seem to run at unexpected times relative to the clock you're used to.
What's Included
- Setting the correct system timezone for your server
- Confirming the change is reflected in the date command and system logs
- Checking whether any running services (web server, database, application) need their own separate timezone setting updated too
- A quick explanation of UTC vs local time trade-offs for your specific use case
What's NOT Included
- Changing timezone settings inside individual applications beyond pointing you to where they live
- Daylight saving time handling specifics beyond what the standard timezone database provides
- Ongoing timezone-related debugging in application code
How It Works
- Check the current system timezone with timedatectl.
- Set the correct timezone using timedatectl set-timezone with the appropriate Region/City value.
- Confirm the change with the date command and check that new log entries reflect it.
- Check whether the database server or application stack has its own independent timezone setting that also needs updating.
- Document the decision (UTC vs local) if the application itself should remain on UTC internally for consistency.
In practice: you buy the service, send over whatever access or details the job needs, I investigate and do the work, and you confirm it's resolved before we call it done.
Frequently Asked Questions
- Should my server use UTC or my local timezone?
- Many sysadmins keep servers on UTC internally for consistency across logs and distributed systems, then handle timezone conversion at the application or display layer — but for a single server you manage directly, local time is often simpler.
- Why do my cron jobs run at the wrong time?
- Cron uses the system's configured timezone, so if the server is set to UTC and you scheduled a job thinking in local time, it runs several hours off from what you expected.
- Does changing the server timezone affect my database's stored timestamps?
- It depends on how the database stores and interprets dates — many databases have their own separate timezone setting that doesn't automatically follow the OS, so it's worth checking separately.
- How do I check my server's current timezone?
- The timedatectl command (on most modern Linux distros) shows the current timezone along with the local and UTC time side by side.
- Will changing the timezone break anything currently running?
- It can shift the apparent run time of anything scheduled by the system clock (cron jobs, log rotation), so it's worth reviewing scheduled tasks after the change to confirm they still fire when expected.
- What timezone format does Linux expect?
- The standard IANA format like Europe/London or America/New_York, rather than an abbreviation like GMT or EST, since it properly accounts for daylight saving rules for that specific region.