1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Understanding the temporal specificities of servers
This guide covers server synchronization via the NTP (Network Time Protocol) protocol and timezone configuration on Infomaniak servers.
Precise synchronization of servers via NTP
Infomaniak servers are all synchronized via the NTP protocol. The company makes available its own publicly available NTP stratum-1 servers for flexible use.
To integrate these servers into your settings, use the following recording: pool.ntp.infomaniak.ch
.
The default timezone configuration is UTC. However, PHP functions are designed to take into account different timezones according to specific needs.
To adjust the timezone in your PHP scripts, use the function date_default_timezone_set('UTC')
.
MySQL: temporal specificities
The Infomaniak infrastructure supports the functionality to work with time data accurately and efficiently, taking into account time zones, which is crucial for many modern applications:
- MySQL uses a time zone database to store and manage time zone information.
- The table
mysql.time_zone
contains time zone data, including information on time lags, time zone names, etc. - The CONVERT_TZ function is used to convert one hour from one time zone to another in MySQL with the following syntax:
CONVERT_TZ(dt, from_tz, to_tz)
, where:dt
is the date/time to be converted.from_tz
is the source time zone.to_tz
is the target time zone.
- Example:
CONVERT_TZ('2024-05-14 12:00:00', 'UTC', 'America/New_York')
Convert time 12:00:00 UTC to local time in New York.