Teks sumber — English
Terjemahan — Bahasa Indonesia
Function :func:`strptime` can parse 2-digit years when given ``%y`` format code. When 2-digit years are parsed, they are converted according to the POSIX and ISO C standards: values 69--99 are mapped to 1969--1999, and values 0--68 are mapped to 2000--2068.
The time value as returned by :func:`gmtime`, :func:`localtime`, and :func:`strptime`, and accepted by :func:`asctime`, :func:`mktime` and :func:`strftime`, is a sequence of 9 integers. The return values of :func:`gmtime`, :func:`localtime`, and :func:`strptime` also offer attribute names for individual fields.
Return the resolution (precision) of the specified clock *clk_id*. Refer to :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*.
Return the time of the specified clock *clk_id*. Refer to :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*.
*implementation*: The name of the underlying C function used to get the clock value. Refer to :ref:`time-clock-id-constants` for possible values.
:func:`localtime` may raise :exc:`OverflowError`, if the timestamp is outside the range of values supported by the platform C :c:func:`localtime` or :c:func:`gmtime` functions, and :exc:`OSError` on :c:func:`localtime` or :c:func:`gmtime` failure. It's common for this to be restricted to years between 1970 and 2038.
The *format* parameter uses the same directives as those used by :func:`strftime`; it defaults to ``"%a %b %d %H:%M:%S %Y"`` which matches the formatting returned by :func:`ctime`. If *string* cannot be parsed according to *format*, or if it has excess data after parsing, :exc:`ValueError` is raised. The default values used to fill in any missing data when more accurate values cannot be inferred are ``(1900, 1, 1, 0, 0, 0, 0, 1, -1)``. Both *string* and *format* must be strings.
Support for the ``%Z`` directive is based on the values contained in ``tzname`` and whether ``daylight`` is true. Because of this, it is platform-specific except for recognizing UTC and GMT which are always known (and are considered to be non-daylight savings timezones).
The type of the time value sequence returned by :func:`gmtime`, :func:`localtime`, and :func:`strptime`. It is an object with a :term:`named tuple` interface: values can be accessed by index and by attribute name. The following values are present:
Values
Nilai
Note that even though the time is always returned as a floating-point number, not all systems provide time with a better precision than 1 second. While this function normally returns non-decreasing values, it can return a lower value than a previous call if the system clock has been set back between the two calls.