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