1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2024-11-14 20:35:54 +05:30

add year_2038_bug.py

This commit is contained in:
Intel A80486DX2-66 2024-06-26 22:38:55 +03:00
parent ce575434ef
commit 8c4f499b24
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -0,0 +1,14 @@
#!/usr/bin/python3
# year_2038_bug.py
#
# Author: Intel A80486DX2-66
# License: Unlicense
from ctypes import c_int, sizeof
from datetime import datetime, timedelta
BITS_IN_BYTE = 8
MAX_INT_VALUE = max_value = 2 ** (sizeof(c_int) * BITS_IN_BYTE - 1) - 1
print((datetime(1970, 1, 1) + timedelta(seconds=MAX_INT_VALUE)).ctime())