Create a gist now

Instantly share code, notes, and snippets.

# -*- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment