from dateutil import tz
import datetime
import pytz
now = datetime.datetime.now(tz.UTC)
print(now.astimezone(tz.gettz("America/Mexico_City")))
# output -- 2023-05-16 09:59:43.668933-05:00
now = datetime.datetime.now(pytz.timezone("UTC"))
print(now.astimezone(pytz.timezone("America/Mexico_City")))
# output -- 2023-05-16 08:59:43.668933-06:00
In both cases there is discrepancy in offset value as gettz is showing -5:00 and using pytz it is showing -6:00. This discrepancy can also be found in some other time zones.
In both of these pytz is showing correctly but tz.gettz gives an incorrect offset value. Why is gettz showing an incorrect value am I using incorrectly?