Home
last modified time | relevance | path

Searched refs:dtstr (Results 1 – 4 of 4) sorted by relevance

/third_party/python/Lib/test/test_email/
Dtest_utils.py58 for dtstr in invalid_dates:
59 with self.subTest(dtstr=dtstr):
60 self.assertRaises(ValueError, utils.parsedate_to_datetime, dtstr)
/third_party/python/Modules/
D_datetimemodule.c694 parse_isoformat_date(const char *dtstr, int *year, int *month, int *day) in parse_isoformat_date() argument
703 const char *p = dtstr; in parse_isoformat_date()
780 parse_isoformat_time(const char *dtstr, size_t dtlen, int *hour, int *minute, in parse_isoformat_time() argument
793 const char *p = dtstr; in parse_isoformat_time()
794 const char *p_end = dtstr + dtlen; in parse_isoformat_time()
803 int rv = parse_hh_mm_ss_ff(dtstr, tzinfo_pos, hour, minute, second, in parse_isoformat_time()
2961 date_fromisoformat(PyObject *cls, PyObject *dtstr) in date_fromisoformat() argument
2963 assert(dtstr != NULL); in date_fromisoformat()
2965 if (!PyUnicode_Check(dtstr)) { in date_fromisoformat()
2973 const char *dt_ptr = PyUnicode_AsUTF8AndSize(dtstr, &len); in date_fromisoformat()
[all …]
/third_party/python/Lib/test/
Ddatetimetester.py2595 dtstr = "{}{:02d}{:02d} {}".format(sign, hours, minutes, tzname)
2596 dt = strptime(dtstr, "%z %Z")
2600 dtstr, fmt = "+1234 UTC", "%z %Z"
2601 dt = strptime(dtstr, fmt)
2605 self.assertEqual(dt.strftime(fmt), dtstr)
2912 dtstr = dt.isoformat(sep=sep)
2914 with self.subTest(dtstr=dtstr):
2915 dt_rt = self.theclass.fromisoformat(dtstr)
2937 dtstr = dt.isoformat()
2939 with self.subTest(tstr=dtstr):
[all …]
/third_party/python/Lib/
Ddatetime.py265 def _parse_isoformat_date(dtstr): argument
268 year = int(dtstr[0:4])
269 if dtstr[4] != '-':
270 raise ValueError('Invalid date separator: %s' % dtstr[4])
272 month = int(dtstr[5:7])
274 if dtstr[7] != '-':
277 day = int(dtstr[8:10])