Skip to content

Instantly share code, notes, and snippets.

@arthurfurlan
Created November 9, 2012 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arthurfurlan/4042788 to your computer and use it in GitHub Desktop.
Save arthurfurlan/4042788 to your computer and use it in GitHub Desktop.
# -*- 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