1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Understand the temporal specifics of servers
This guide concerns 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 set to UTC. However, PHP functions are designed to accommodate different timezones according to specific needs.
To adjust the timezone in your PHP scripts, use the function date_default_timezone_set('UTC')
.
MySQL: time specifics
Infomaniak's infrastructure supports features for working with time data precisely 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 about time offsets, time zone names, etc. - The function CONVERT_TZ 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:dt
is the date/time to convert.from_tz
is the source timezone.to_tz
is the target timezone.
- Example:
CONVERT_TZ('2024-05-14 12:00:00', 'UTC', 'America/New_York')
will convert the time 12:00:00 UTC to local time in New York.