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
‹
›
Home
View web version
No comments:
Post a Comment