Linux timestamp and UTC time

First understand a few time-related concepts.

GMT time : Greenwich Mean Time, Greenwich Mean Time, also known as Greenwich Mean Time or Greenwich Mean Time. Refers to the standard time at the Royal Greenwich Observatory located on the outskirts of London, England.

GMT has a large error, so it is no longer used as a standard time. The current standard time is Coordinated Universal Time (UTC) as reported by atomic clocks

UTC time : Universal Time Coordinated, Chinese name: World Standard Time or Universal Coordinated Time.

UTC time can be understood as a common time all over the world . It actually reflects a convention, that is, a unified time recognized by the whole world, rather than the time of a specific region.

Beijing time commonly used by Chinese is 8 hours ahead of UTC time. That is, when UTC time is 0:00 am, Beijing time is already 8:00 am, which is why people all over the world often do not directly use UTC time for timekeeping.

CST time : China Standard Time, that is, China Standard Time. In terms of time zone division, it belongs to the East Eighth District, which is 8 hours earlier than the Coordinated Universal Time, which is recorded as UTC+8.

UNIX timestamp (timestamp): The UNIX timestamp in the computer is the number of seconds from the GMT/UTC time 1970-01-01T00:00:00 to the current specific time (leap seconds are not considered). The purpose of doing this is mainly to simplify the complexity of computer operations on time through "integer calculation".

check local time

Check the UTC time, which is consistent with the local time, and the local time is UTC+8 time

View the timestamp of the current time

Convert timestamp to UTC time, such as 1678445218 conversion

Guess you like

Origin blog.csdn.net/hhhlizhao/article/details/129432653
Recommended