Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Generates a lot of statistics about the current date and time
- #Steve Basford 2015
- import time
- import datetime
- print ("Time in seconds since the epoch: %s" %time.time())
- print ("Current date and time: " , datetime.datetime.now())
- print ("Or like this: " ,datetime.datetime.now().strftime("%y-%m-%d-%H-%M"))
- print ("Current year: ", datetime.date.today().strftime("%Y"))
- print ("Month of year: ", datetime.date.today().strftime("%B"))
- print ("Week number of the year: ", datetime.date.today().strftime("%W"))
- print ("Weekday of the week: ", datetime.date.today().strftime("%w"))
- print ("Day of year: ", datetime.date.today().strftime("%j"))
- print ("Day of the month : ", datetime.date.today().strftime("%d"))
- print ("Day of week: ", datetime.date.today().strftime("%A"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement