Knowledge base
1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!
Understanding the time-related specificities of servers
This guide covers synchronizing servers via the NTP (Network Time Protocol) and configuring the timezone on Infomaniak servers.
Accurate server synchronization via NTP
Infomaniak's servers are all synchronized via the NTP protocol. The company provides its own stratum-1 NTP servers, which are publicly accessible for flexible use.
To integrate these servers into your settings, use the following entry: pool.ntp.infomaniak.ch.
The default timezone setting is UTC. However, PHP functions are designed to take different timezones into account based on specific needs.
To adjust the timezone in your PHP scripts, use the date_default_timezone_set('UTC') function.
MySQL: Temporal Specificities
The Infomaniak infrastructure supports features that allow you to work with temporal data in a precise and efficient manner, taking time zones into account, which is crucial for many modern applications:
- MySQL uses a time zone database to store and manage time zone information.
- The
mysql.time_zonetable contains time zone data, including information on time offsets, time zone names, etc. - The
CONVERT_TZfunction is used to convert a time from one time zone to another in MySQL, using the following syntax:CONVERT_TZ(dt, from_tz, to_tz), where:dtis the date/time to be converted.from_tzis the source time zone.to_tzis the target time zone.
- Example:
CONVERT_TZ('2024-05-14 12:00:00', 'UTC', 'America/New_York')will convert the time 12:00:00 UTC to the local time in New York.
Link to this FAQ: https://faq.infomaniak.com/487
Has this FAQ been helpful?