Simplifies the logic and improves readability by moving datetime-specific code branches to datetime class.
Also resolves some code linter warnings about attributes not being defined on date class.
_strftime_p: only raises Exception (AttributeError) on date objects because dates do not have hour attribute.
_strftime_z: only raises AttributeError on a date class becuase date does not have utcoffset attribute.
_strftime_cap_z: date does not have tzname attribute, but datetime has.
Simplifies the logic and improves readability by moving datetime-specific code branches to datetime class. Also resolves some code linter warnings about attributes not being defined on date class.
_strftime_p: only raises Exception (AttributeError) on date objects because dates do not have hour attribute.
_strftime_z: only raises AttributeError on a date class becuase date does not have utcoffset attribute.
_strftime_cap_z: date does not have tzname attribute, but datetime has.