python strptime remove timezone code example Example: python datetime remove timezone # dt_tz is a datetime.datetime object dt = dt_tz.replace(tzinfo=None)