Computes the difference between two dates





6
Date Submitted Fri. Aug. 18th, 2006 11:01 AM
Revision 1 of 1
Scripter ASmith
Tags Date | python
Comments 0 comments
Computes the difference between two dates in seconds

###
Description: Compute the difference between two dates in seconds
URL: http://sebsauvage.net/python/snyppets/index.html
License: Unspecified/Public Domain
###
import datetime,time
def dateDiffInSeconds(date1, date2):
  timedelta = date2 - date1
  return timedelta.days*24*3600 + timedelta.seconds
 

Comments

There are currently no comments for this snippet.

Voting