#!/usr/bin/env python3
#=====================================================================================
# Python Accessing Date and Time
# using time module  
#=====================================================================================
import time

print("Content-Type: text/html \n")     #http header with newline char (required for the web)
print('<pre>')                          #to produce better display on the web 

secs       = time.time()                             #get num of sec since Epoch
dateTime   = time.ctime()                            #current date and time
formatted  = time.strftime('%m/%d/%Y @ %H:%M:%S %z')
daylight   = time.daylight
timezone   = time.tzname
gmt_offset = time.strftime('%z')  
        
print('The Number of Seconds since Epoch........:' , secs      )               
print('The Current Date and Time using ctime( ).:' , dateTime  )
print('Formatting the Date and Time.............:' , formatted )
print('Daylight Savings Time?...................:' , daylight  )
print('Local Timezone...........................:' , timezone  )
print('Timezone offset to GMT...................:' , gmt_offset)
print()

var1 =1
var2 =1000000
count=0
start = time.clock() 
for loop in range(var1,var2):                       #kill time
    count += 1
end = time.clock()
elapse = end-start

print('Counting from', var1, 'to', var2, 'took', elapse, 'seconds')