Created
November 9, 2012 00:08
-
-
Save arthurfurlan/4042788 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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() | |
## 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