cleaned up and fixed all datetime conversions