- 1). Open your Python editor.
- 2). Type:
import time;
tickTock = time.time()
print "Number of seconds since 12:00am, May 28, 2011:", tickTock - 3). Press "Enter." Python returns:
"Number of seconds since 12:00am, May 28, 2011: 1307096391.56"
In this example, you import the time module and Python calculates the amount of seconds in floating point format that has passed between 12:00am on May 28, 2011 to the current time on June 3, 2011.
previous post