https://github.com/stscoundrel/year-2038-problem-cpp
Demonstration of year 2038 problem in C++
https://github.com/stscoundrel/year-2038-problem-cpp
cpp integer-overflow y2k y2k38 year-2038-problem
Last synced: 6 months ago
JSON representation
Demonstration of year 2038 problem in C++
- Host: GitHub
- URL: https://github.com/stscoundrel/year-2038-problem-cpp
- Owner: stscoundrel
- License: mit
- Created: 2021-07-22T06:56:54.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-20T13:18:35.000Z (almost 4 years ago)
- Last Synced: 2025-03-25T07:38:24.969Z (about 1 year ago)
- Topics: cpp, integer-overflow, y2k, y2k38, year-2038-problem
- Language: C++
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Year 2038 problem
Demonstration of year 2038 problem in C++.
The year 2038 problem refers to maximum unix date that can be stored in i32 value. 03:14:07 UTC on 19 January 2038, the integer will overflow. Result will be incorrect time calculation, around 20:45:52 on Friday, 13 December 1901.
## The test
- Creates maximum value for i32
- Increase it by one
- In very simplified way, parse current year from the timestamp. Ignores constraints like leap years, leap seconds etc.
## To run
`g++ -o 2038 src/main.cpp`
`./2038`