Datetime module from the python standard library.

#Importing the string module

import time
 
#lets get the UNIXTIMESTAMP or seconds from epoch which is 1/1/1970 00:00:00
 
import time
time.time()
 
#Days since epoch
time.time()/(60*60*24)
 
#3 ways to print the current date in human readable format
print time.asctime(time.localtime())
print  time.ctime(time.time())
print  time.ctime()
 
#find the timezone of the server
time.timezone
 
#GMT time since epoch
time.gmtime()

Categorized in:

Tagged in:

, , , ,