MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _check_time_fields

Function _check_time_fields

tools/python-3.11.9-amd64/Lib/datetime.py:528–543  ·  view source on GitHub ↗
(hour, minute, second, microsecond, fold)

Source from the content-addressed store, hash-verified

526 return year, month, day
527
528def _check_time_fields(hour, minute, second, microsecond, fold):
529 hour = _index(hour)
530 minute = _index(minute)
531 second = _index(second)
532 microsecond = _index(microsecond)
533 if not 0 <= hour <= 23:
534 raise ValueError('hour must be in 0..23', hour)
535 if not 0 <= minute <= 59:
536 raise ValueError('minute must be in 0..59', minute)
537 if not 0 <= second <= 59:
538 raise ValueError('second must be in 0..59', second)
539 if not 0 <= microsecond <= 999999:
540 raise ValueError('microsecond must be in 0..999999', microsecond)
541 if fold not in (0, 1):
542 raise ValueError('fold must be either 0 or 1', fold)
543 return hour, minute, second, microsecond, fold
544
545def _check_tzinfo_arg(tz):
546 if tz is not None and not isinstance(tz, tzinfo):

Callers 2

__new__Method · 0.85
__new__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected