课程: Linux Tips

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

UNIX time and the 2038 problem

UNIX time and the 2038 problem - Linux教程

课程: Linux Tips

UNIX time and the 2038 problem

- [Instructor] Unix and Linux systems keep track of time by counting the seconds since January 1st 1970 UTC, or Coordinated Universal Time. That number of second is called Unix time or Epoch time. Working with this number can be a little tricky. Since it's not represented as a human readable date. There are websites that convert back and forth between Epoch time and various date strings, and the date utility can help us out with that as well. Historically the Epoch time is stored as a 32-bit signed integer. Here's an example of what that looks like in binary. We can see the current local Unix time with a date command, and a format string representing seconds. We can also get the current UTC time by adding the -U option. And we can get the Unix time for a specific date with a date command, a formatted string with the seconds, the UTC option, and the date option. And for the date option I'll provide a date. We can add times…

内容