Replace function that only works with Python 2.7+

Removed timedelta.total_seconds() since it requires Python 2.7+, which apparently isn't running on the dev server.