1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Understanding the temporal specifics of servers
This guide covers the synchronization of servers via the NTP (Network Time Protocol) and the configuration of the timezone on Infomaniak servers.
Precise server synchronization via NTP
All Infomaniak servers are synchronized via the NTP protocol. The company provides its own public-accessible stratum-1 NTP servers for flexible use.
To integrate these servers into your settings, use the following entry: pool.ntp.infomaniak.ch.
The default timezone configuration is in UTC. However, PHP functions are designed to accommodate different timezones based on specific needs.
To adjust the timezone in your PHP scripts, use the function date_default_timezone_set('UTC').
MySQL: temporal specifics
Infomaniak's infrastructure supports features for working with temporal data accurately and efficiently, taking into account timezones, which is crucial for many modern applications:
- MySQL uses a timezone database to store and manage timezone information.
- The
mysql.time_zonetable contains timezone data, including time offset information, timezone names, etc. - The CONVERT_TZ function is used to convert a time from one timezone to another in MySQL with the following syntax:
CONVERT_TZ(dt, from_tz, to_tz), where:dtis the date/time to convert.from_tzis the source timezone.to_tzis the target timezone.
- Example:
CONVERT_TZ('2024-05-14 12:00:00', 'UTC', 'America/New_York')will convert 12:00:00 UTC to local time in New York.