Year 2018 Timestamp Problem

From LinuxReviews
Jump to navigationJump to search

The standard Unix time format is stored as a signed 32-bit integer which counts the number of seconds passed since January 1st, 1970. This becomes a problem at 03:14:07 on Tuesday, 19 January 2038 (231-1 = 2,147,483,647 seconds after 1 January 1970) when the integer's full (integer overflow). The integer's sign bit will flip and the integer will get it's maximum negative value and count up towards zero from there.

Linux

The Linux kernel uses a 64-bit time_t on 64-bit architectures. The 32-bit ABI does not and Linux will keep on using a 32-bit time_t on 32-bit architectures for backwards compatibility (there are, of course, those who are trying to get support for 64-bit timestamps on 32-bit architectures into the kernel; it could happen).

Not all areas of the Linux kernel are future-proof against the year 2038 problem. The ext4 file systems will as of kernel 5.4.0 produce this warning when they are mounted:

ext4 filesystem being mounted at (mountpoint) supports timestamps until 2038 (0x7fffffff)


Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.