Overview
The extension relies on accurate system and database timestamps to function correctly. Incorrect date, time, or timezone configurations can lead to display discrepancies, logging errors, or synchronization issues. This article outlines the verification steps for operating system and MySQL timezone settings, along with methods to validate stored timestamps.
Prerequisites
- Root or sudo access to the server via SSH
Verify Server Time and Timezone Configuration
The extension determines the active timezone by reading the system symlink. Verify that /etc/localtime points to the correct timezone file within /usr/share/zoneinfo/.
# ls -l /etc/localtime
lrwxrwxrwx. 1 root root 36 Oct 30 2020 /etc/localtime -> /usr/share/zoneinfo/America/Edmonton
If the symlink is missing or references an incorrect timezone, update it using one of the following reference guides:
Verify MySQL Database Timezone
Certain database columns utilize the MySQL NOW() function to generate timestamps. Ensure the MySQL timezone aligns with the system time returned by the date command.
# mysql -u admin -p`cat /etc/psa/.psa.shadow` -s -N -e "SELECT NOW();"
2024-10-15 10:27:06
# date
Tue Oct 15 10:27:10 MDT 2024
If the timestamps do not match, configure the MySQL timezone using the following reference:
Validate Timestamps in the Warden Database
After verifying system and database settings, confirm that recent records are stored with accurate timestamps by querying the danami_warden database:
plesk db -s -N -e "use danami_warden; select time_iso, subject, from_addr from msgs order by time_iso DESC limit 5;"
Review the query output to ensure the time_iso values reflect the correct date and time.
Troubleshooting & Common Issues
- Mismatched System and Database Times: If the server timezone is correct but MySQL displays incorrect times, apply the MySQL timezone configuration steps above. Restart the database service if changes do not take effect immediately.
- Incorrect Symlink Target: Ensure /etc/localtime points to a valid path under /usr/share/zoneinfo/. Invalid or broken symlinks will cause fallback behavior or default to UTC.