public
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
# -*- coding: utf-8 -*-
 
import time, datetime
 
def print_time(when=time.time()):
print when
 
def print_date(when=datetime.datetime.now()):
print when
 
## testing time
print_time()
time.sleep(5)
print_time()
 
print
 
## testing date
print_date()
time.sleep(5)
print_date()
 
 
## script output:
## --------------------------
## 1352419610.68
## 1352419610.68
##
## 2012-11-08 22:06:50.684373
## 2012-11-08 22:06:50.684373

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.