Make datetime attribute of timestamps valid