/third_party/python/Lib/test/ |
H A D | datetimetester.py | 29 from datetime import tzinfo namespace 89 'tzinfo', 'UTC', 'sys']) 121 # tzinfo tests 123 class FixedOffset(tzinfo): 150 class _TZInfo(tzinfo): 166 useless = tzinfo() 173 class NotEnough(tzinfo): 177 self.assertTrue(issubclass(NotEnough, tzinfo)) 179 self.assertIsInstance(ne, tzinfo) 188 self.assertIsInstance(fo, tzinfo) 3288 tzinfo=timezone(timedelta(hours=10, minutes=45))) global() variable in TestDateTime.test_fromisoformat_subclass.DateTimeSubclass [all...] |
H A D | test_logging.py | 3862 class UTC(datetime.tzinfo):
|
/third_party/python/Doc/includes/ |
H A D | tzinfo_examples.py | 1 from datetime import tzinfo, timedelta, datetime namespace 21 class LocalTimezone(tzinfo): 24 assert dt.tzinfo is self 25 stamp = (dt - datetime(1970, 1, 1, tzinfo=self)) // SECOND 31 tzinfo=self, fold=fold) 110 class USTimeZone(tzinfo): 131 if dt is None or dt.tzinfo is None: 135 # implementation) passes a datetime with dt.tzinfo is self. 137 assert dt.tzinfo is self 141 dt = dt.replace(tzinfo [all...] |
/third_party/python/Modules/ |
H A D | _datetimemodule.c | 658 * We abuse the tp_alloc "nitems" argument to communicate whether a tzinfo 661 * struct that has room for the tzinfo member, so subclasses in Python will 662 * allocate enough space for a tzinfo member whether or not one is actually 989 int second, int usecond, PyObject *tzinfo, int fold, PyTypeObject *type) in new_datetime_ex2() 992 char aware = tzinfo != Py_None; in new_datetime_ex2() 1000 if (check_tzinfo_subclass(tzinfo) < 0) { in new_datetime_ex2() 1013 Py_INCREF(tzinfo); in new_datetime_ex2() 1014 self->tzinfo = tzinfo; in new_datetime_ex2() 1023 int second, int usecond, PyObject *tzinfo, PyTypeObjec in new_datetime_ex() 988 new_datetime_ex2(int year, int month, int day, int hour, int minute, int second, int usecond, PyObject *tzinfo, int fold, PyTypeObject *type) new_datetime_ex2() argument 1022 new_datetime_ex(int year, int month, int day, int hour, int minute, int second, int usecond, PyObject *tzinfo, PyTypeObject *type) new_datetime_ex() argument 1034 new_datetime_subclass_fold_ex(int year, int month, int day, int hour, int minute, int second, int usecond, PyObject *tzinfo, int fold, PyObject *cls) new_datetime_subclass_fold_ex() argument 1059 new_datetime_subclass_ex(int year, int month, int day, int hour, int minute, int second, int usecond, PyObject *tzinfo, PyObject *cls) new_datetime_subclass_ex() argument 1069 new_time_ex2(int hour, int minute, int second, int usecond, PyObject *tzinfo, int fold, PyTypeObject *type) new_time_ex2() argument 1100 new_time_ex(int hour, int minute, int second, int usecond, PyObject *tzinfo, PyTypeObject *type) new_time_ex() argument 1233 PyObject *tzinfo = NULL; get_tzinfo_member() local 1251 call_tzinfo_method(PyObject *tzinfo, const char *name, PyObject *tzinfoarg) call_tzinfo_method() argument 1297 call_utcoffset(PyObject *tzinfo, PyObject *tzinfoarg) call_utcoffset() argument 1311 call_dst(PyObject *tzinfo, PyObject *tzinfoarg) call_dst() argument 1323 call_tzname(PyObject *tzinfo, PyObject *tzinfoarg) call_tzname() argument 1357 append_keyword_tzinfo(PyObject *repr, PyObject *tzinfo) append_keyword_tzinfo() argument 1403 PyObject *tzinfo; tzinfo_from_isoformat_results() local 1462 format_utcoffset(char *buf, size_t buflen, const char *sep, PyObject *tzinfo, PyObject *tzinfoarg) format_utcoffset() argument 1513 PyObject *tzinfo = get_tzinfo_member(object); make_Zreplacement() local 1638 PyObject *tzinfo = get_tzinfo_member(object); wrap_strftime() local 4206 time_from_pickle(PyTypeObject *type, PyObject *state, PyObject *tzinfo) time_from_pickle() argument 4246 PyObject *tzinfo = Py_None; time_new() local 4604 PyObject *tzinfo = HASTZINFO(self) ? self->tzinfo : Py_None; time_replace() local 4661 PyObject *tzinfo = tzinfo_from_isoformat_results(rv, tzoffset, time_fromisoformat() local 4883 datetime_from_pickle(PyTypeObject *type, PyObject *state, PyObject *tzinfo) datetime_from_pickle() argument 4927 PyObject *tzinfo = Py_None; datetime_new() local 5031 datetime_from_timet_and_us(PyObject *cls, TM_FUNC f, time_t timet, int us, PyObject *tzinfo) datetime_from_timet_and_us() argument 5103 datetime_from_timestamp(PyObject *cls, TM_FUNC f, PyObject *timestamp, PyObject *tzinfo) datetime_from_timestamp() argument 5121 datetime_best_possible(PyObject *cls, TM_FUNC f, PyObject *tzinfo) datetime_best_possible() argument 5185 PyObject *tzinfo = Py_None; datetime_fromtimestamp() local 5246 PyObject *tzinfo = NULL; datetime_combine() local 5503 PyObject *tzinfo = tzinfo_from_isoformat_results(rv, tzoffset, tzusec); datetime_fromisoformat() local 6060 PyObject *tzinfo = HASTZINFO(self) ? self->tzinfo : Py_None; datetime_replace() local 6205 PyObject *tzinfo = Py_None; datetime_astimezone() local 6441 PyObject *tzinfo; datetime_utctimetuple() local [all...] |
H A D | timemodule.c | 1756 TIME_ZONE_INFORMATION tzinfo = {0}; local 1757 GetTimeZoneInformation(&tzinfo); 1758 otz0 = PyUnicode_FromWideChar(tzinfo.StandardName, -1); 1762 otz1 = PyUnicode_FromWideChar(tzinfo.DaylightName, -1);
|
H A D | _testcapimodule.c | 2938 PyObject *tsargs = NULL, *ts = NULL, *tzinfo = Py_None, *rv = NULL; in get_datetime_fromtimestamp() local 2939 if (!PyArg_ParseTuple(args, "OO|pp", &ts, &tzinfo, &usetz, ¯o)) { in get_datetime_fromtimestamp() 2945 tsargs = PyTuple_Pack(2, ts, tzinfo); in get_datetime_fromtimestamp() 2990 PyObject *tzinfo = PyDateTime_DATE_GET_TZINFO(obj); in test_PyDateTime_DATE_GET() local 2992 return Py_BuildValue("(iiiiO)", hour, minute, second, microsecond, tzinfo); in test_PyDateTime_DATE_GET() 3004 PyObject *tzinfo = PyDateTime_TIME_GET_TZINFO(obj); in test_PyDateTime_TIME_GET() local 3006 return Py_BuildValue("(iiiiO)", hour, minute, second, microsecond, tzinfo); in test_PyDateTime_TIME_GET()
|
/third_party/python/Lib/test/test_email/ |
H A D | test_utils.py | 17 aware_dt = datetime.datetime(*dateargs, tzinfo=tz) 29 tzinfo=datetime.timezone.utc) 76 self.assertIsNotNone(t.tzinfo) 81 self.assertIsNotNone(t.tzinfo) 116 t0 = datetime.datetime(1990, 1, 1, tzinfo = datetime.timezone.utc) 119 t2 = t2.replace(tzinfo = datetime.timezone(datetime.timedelta(hours=-5))) 125 t0 = datetime.datetime(1990, 1, 1, tzinfo = datetime.timezone.utc) 128 t2 = t2.replace(tzinfo = datetime.timezone(datetime.timedelta(hours=-5))) 135 t2 = utils.localtime(t0.replace(tzinfo=None)) 142 t2 = utils.localtime(t0.replace(tzinfo [all...] |
H A D | test_headerregistry.py | 175 dt = datetime.datetime(2001, 9, 23, 20, 10, 55, tzinfo=tz)
|
/third_party/python/Lib/ |
H A D | datetime.py | 7 __all__ = ("date", "datetime", "time", "timedelta", "timezone", "tzinfo", 494 raise TypeError("tzinfo.tzname() must return None or string, " 508 raise TypeError("tzinfo.%s() must return None " 546 if tz is not None and not isinstance(tz, tzinfo): 547 raise TypeError("tzinfo argument must be None or of a tzinfo subclass") 1009 >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc) 1011 'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)' 1223 class tzinfo: class 1232 raise NotImplementedError("tzinfo subclas 1401 def tzinfo(self): global() member in time 1734 def tzinfo(self): global() member in datetime [all...] |
H A D | imaplib.py | 1531 dt = datetime(*date_time[:6], tzinfo=timezone(delta)) 1533 if date_time.tzinfo is None:
|
/third_party/python/Lib/email/ |
H A D | utils.py | 164 if dt.tzinfo is None or dt.tzinfo != datetime.timezone.utc: 167 elif dt.tzinfo is None: 205 tzinfo=datetime.timezone(datetime.timedelta(seconds=tz))) 340 naive (that is, dt.tzinfo is None), it is assumed to be in local time. 350 if dt.tzinfo is not None: 371 return dt.replace(tzinfo=tz)
|
/third_party/python/Lib/test/test_zoneinfo/ |
H A D | test_zoneinfo.py | 106 tzinfo=dt.tzinfo, 258 (datetime(2019, 1, 1, tzinfo=timezone.utc), ValueError), 273 dt = datetime(2020, 1, 1, tzinfo=zi) 302 dt = dt.replace(tzinfo=tzi) 357 dt = dt.replace(fold=fold, tzinfo=tzi) 385 t = time(11, 15, 1, 34471, tzinfo=zi) 396 t = time(11, 15, 1, 34471, tzinfo=zi) 433 tzinfo=dt.tzinfo, variable in CZoneInfoTest.test_fold_mutate.to_subclass.SameAddSubclass [all...] |
/third_party/python/Lib/tomllib/ |
H A D | _re.py | 7 from datetime import date, datetime, time, timedelta, timezone, tzinfo namespace 77 tz: tzinfo | None = cached_tz( 84 return datetime(year, month, day, hour, minute, sec, micros, tzinfo=tz)
|
/third_party/python/Include/ |
H A D | datetime.h | 49 /* The datetime and time types have hashcodes, and an optional tzinfo member, 67 * in two ways, with or without a tzinfo member. Without is the same as 68 * tzinfo == None, but consumes less memory. _PyDateTime_BaseTime is an 85 PyObject *tzinfo; member 113 PyObject *tzinfo; member 136 ((PyDateTime_DateTime *)(o))->tzinfo : Py_None) 148 ((PyDateTime_Time *)(o))->tzinfo : Py_None)
|
/third_party/curl/lib/ |
H A D | parsedate.c | 120 struct tzinfo { struct 128 static const struct tzinfo tz[]= { 252 const struct tzinfo *what = tz; in checktz()
|
/third_party/PyYAML/lib/yaml/ |
H A D | constructor.py | 335 tzinfo = None 347 tzinfo = datetime.timezone(delta) 349 tzinfo = datetime.timezone.utc 351 tzinfo=tzinfo)
|
/third_party/python/Lib/test/test_tomllib/ |
H A D | test_misc.py | 86 tzinfo=datetime.timezone(datetime.timedelta(hours=-7)),
|
H A D | burntsushi.py | 33 if obj.tzinfo:
|
/third_party/python/Lib/zoneinfo/ |
H A D | _zoneinfo.py | 7 from datetime import datetime, timedelta, tzinfo namespace 30 class ZoneInfo(tzinfo): 119 if dt.tzinfo is not self: 120 raise ValueError("dt.tzinfo is not self")
|
/third_party/python/Mac/Tools/ |
H A D | plistlib_generate_testdata.py | 32 seconds = datetime.datetime(2004, 10, 26, 10, 33, 33, tzinfo=datetime.timezone(datetime.timedelta(0))).timestamp()
|
/third_party/PyYAML/tests/lib/ |
H A D | test_constructor.py | 49 tz = dt.tzinfo.tzname(dt) 217 class FixedOffset(datetime.tzinfo):
|
/third_party/python/Lib/http/ |
H A D | server.py | 748 if ims.tzinfo is None: 751 ims = ims.replace(tzinfo=datetime.timezone.utc) 752 if ims.tzinfo is datetime.timezone.utc:
|
/third_party/protobuf/python/google/protobuf/internal/ |
H A D | well_known_types_test.py | 267 class TZ(datetime.tzinfo): 279 dt = datetime.datetime(1970, 1, 1, 1, tzinfo=TZ())
|