py34: add epsilon to milliseconds computation
py34: 0\d -> \d
py26: timedelta.total_seconds compat function