mirror of
				https://gitlab.com/80486DX2-66/gists
				synced 2025-05-31 08:31:41 +05:30 
			
		
		
		
	add year_2038_bug.py
This commit is contained in:
		
							
								
								
									
										14
									
								
								python-programming/year_2038_bug.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								python-programming/year_2038_bug.py
									
									
									
									
									
										Normal 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()) | ||||
		Reference in New Issue
	
	Block a user