#!/usr/bin/python #Print time and date in the region surrounding the Unix 32-bit epoch. #Author: Bill Poser (billposer@alum.mit.edu) import sys import time import math MaximumSignedThirtyOneBitInteger = long(math.pow(2,30)) -1 ThirtyOneBitStart = MaximumSignedThirtyOneBitInteger - 5 ThirtyOneBitEnd = ThirtyOneBitStart + 10 sys.stdout.write("Time and date in the vicinity of the maximum 31 bit signed\n") sys.stdout.write("30 bit unsigned time in seconds since the UNIX epoch (January 1, 1970).\n") sys.stdout.write("If the date suddenly shifts backwards, your system is only using 30 bits.\n") sys.stdout.write("If all of these dates are 1 second apart, your system uses more bits.\n\n") for second in range(ThirtyOneBitStart,ThirtyOneBitEnd,1): sys.stdout.write(time.asctime(time.gmtime(second))) sys.stdout.write('\n') sys.stdout.write('\n') MaximumSignedThirtyTwoBitInteger = long(math.pow(2,31)) -1 ThirtyTwoBitStart = MaximumSignedThirtyTwoBitInteger - 5 ThirtyTwoBitEnd = ThirtyTwoBitStart + 10 sys.stdout.write("Time and date in the vicinity of the maximum 32 bit signed time\n") sys.stdout.write("in seconds since the UNIX epoch (January 1, 1970).\n") sys.stdout.write("If the date suddenly shifts backwards, your system is using 32 bit time.\n") sys.stdout.write("If all of these dates are 1 second apart, your system uses more bits.\n\n") for second in range(ThirtyTwoBitStart,ThirtyTwoBitEnd,1): sys.stdout.write(time.asctime(time.gmtime(second))) sys.stdout.write('\n')