Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stscoundrel/year-2038-problem
Demonstration of year 2038 problem in Rust
https://github.com/stscoundrel/year-2038-problem
integer-overflow rust y2038 y2k y2k38 year-2038-problem
Last synced: 22 days ago
JSON representation
Demonstration of year 2038 problem in Rust
- Host: GitHub
- URL: https://github.com/stscoundrel/year-2038-problem
- Owner: stscoundrel
- License: mit
- Created: 2021-07-21T13:56:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-20T13:19:08.000Z (over 2 years ago)
- Last Synced: 2023-03-04T00:13:05.485Z (almost 2 years ago)
- Topics: integer-overflow, rust, y2038, y2k, y2k38, year-2038-problem
- Language: Rust
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- 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 Rust.
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
- Uses wrapped add to increase it by 1 without causing overflow errors
- In very simplified way, parse current year from the timestamp. Ignores constraints like leap years, leap seconds etc.## To run
`cargo run`