PEP8 compliance, use of strptime, better handling of old Python versions