MySQL has two choices according to the setting of the parameter time_zone when converting from seconds to actual time since the New Era Time (197-1-1 : ):
time_zone? Set to SYSTEM: use the OS session time zone obtained by sys_time_zone and use the OS API for conversion. Corresponding conversion function time _ zone _ system:: GMT _ sec _ to _ time
time _ zone? If it is set to the actual time zone, such as'+8: ', then use MySQL's own method for conversion. The corresponding conversion function Time_zone_offset:: GMT _ sec _ to _ time
In fact, both Time_zone_system and Time_zone _ offset are inherited from the Time_zone class, and the virtual function of the time _ zone class is rewritten, so the upper-level calls are all Time_zone::gmt_sec_to_TIME.