Return a datetime instance based on the input string and the format string.
(cls, data_string, format="%a %b %d %H:%M:%S %Y")
| 828 | return cls(*args, tz) |
| 829 | |
| 830 | def _strptime_datetime_datetime(cls, data_string, format="%a %b %d %H:%M:%S %Y"): |
| 831 | """Return a datetime instance based on the input string and the |
| 832 | format string.""" |
| 833 | tt, fraction, gmtoff_fraction = _strptime(data_string, format) |
| 834 | tzname, gmtoff = tt[-2:] |
| 835 | args = tt[:6] + (fraction,) |
| 836 | if gmtoff is None: |
| 837 | return cls(*args) |
| 838 | else: |
| 839 | tz = _parse_tz(tzname, gmtoff, gmtoff_fraction) |
| 840 | return cls(*args, tz) |