def timedelta2seconds(delta):
 return (((delta.microseconds / 1000000.0) + delta.seconds) + (((delta.days * 60) * 60) * 24))

def timedelta2seconds ( delta ) : return ( ( ( delta . microseconds / 1000000.0 ) + delta . seconds ) + ( ( ( delta . days * 60 ) * 60 ) * 24 ) )
convert a datetime .