MCPcopy Index your code
hub / github.com/RustPython/RustPython / time

Class time

Lib/_pydatetime.py:1384–1737  ·  view source on GitHub ↗

Time with time zone. Constructors: __new__() strptime() Operators: __repr__, __str__ __eq__, __le__, __lt__, __ge__, __gt__, __hash__ Methods: strftime() isoformat() utcoffset() tzname() dst() Properties (readonly): hour, minute, second,

Source from the content-addressed store, hash-verified

1382_tzinfo_class = tzinfo
1383
1384class time:
1385 """Time with time zone.
1386
1387 Constructors:
1388
1389 __new__()
1390 strptime()
1391
1392 Operators:
1393
1394 __repr__, __str__
1395 __eq__, __le__, __lt__, __ge__, __gt__, __hash__
1396
1397 Methods:
1398
1399 strftime()
1400 isoformat()
1401 utcoffset()
1402 tzname()
1403 dst()
1404
1405 Properties (readonly):
1406 hour, minute, second, microsecond, tzinfo, fold
1407 """
1408 __slots__ = '_hour', '_minute', '_second', '_microsecond', '_tzinfo', '_hashcode', '_fold'
1409
1410 def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0):
1411 """Constructor.
1412
1413 Arguments:
1414
1415 hour, minute (required)
1416 second, microsecond (default to zero)
1417 tzinfo (default to None)
1418 fold (keyword only, default to zero)
1419 """
1420 if (isinstance(hour, (bytes, str)) and len(hour) == 6 and
1421 ord(hour[0:1])&0x7F < 24):
1422 # Pickle support
1423 if isinstance(hour, str):
1424 try:
1425 hour = hour.encode('latin1')
1426 except UnicodeEncodeError:
1427 # More informative error message.
1428 raise ValueError(
1429 "Failed to encode latin1 string when unpickling "
1430 "a time object. "
1431 "pickle.load(data, encoding='latin1') is assumed.")
1432 self = object.__new__(cls)
1433 self.__setstate(hour, minute or None)
1434 self._hashcode = -1
1435 return self
1436 hour, minute, second, microsecond, fold = _check_time_fields(
1437 hour, minute, second, microsecond, fold)
1438 _check_tzinfo_arg(tzinfo)
1439 self = object.__new__(cls)
1440 self._hour = hour
1441 self._minute = minute

Callers 15

__init__Method · 0.90
writeMethod · 0.90
handle_requestMethod · 0.90
putMethod · 0.90
getMethod · 0.90
_getdateFunction · 0.90
setUpMethod · 0.90
assert_logMethod · 0.90
test_rate_limitMethod · 0.90
test_extractMethod · 0.90
test_combineMethod · 0.90

Calls

no outgoing calls

Tested by 15

setUpMethod · 0.72
assert_logMethod · 0.72
test_rate_limitMethod · 0.72
test_extractMethod · 0.72
test_combineMethod · 0.72
test_zonesMethod · 0.72
test_combineMethod · 0.72
test_extractMethod · 0.72
test_extra_attributesMethod · 0.72