Technical notes, my online memory
Tuesday, February 23, 2010
Time offsets in python
I always forget how to do time offsets (i.e. current time - 20 seconds) in python. Here's how:
from datetime import datetime,timedelta
datetime.now() - timedelta(seconds=20)
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment