{
    "mode": "pydoc",
    "parameter": "datetime",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/datetime/json",
    "generated": "2026-06-02T14:16:23Z",
    "sections": {
        "NAME": {
            "content": "datetime - Fast implementation of the datetime type.\n",
            "subsections": []
        },
        "MODULE REFERENCE": {
            "content": "https://docs.python.org/3.10/library/datetime.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n",
            "subsections": []
        },
        "CLASSES": {
            "content": "builtins.object\ndate\ndatetime\ntime\ntimedelta\ntzinfo\ntimezone\n",
            "subsections": [
                {
                    "name": "class date",
                    "content": "|  date(year, month, day) --> date object\n|\n|  Methods defined here:\n|\n|  add(self, value, /)\n|      Return self+value.\n|\n|  eq(self, value, /)\n|      Return self==value.\n|\n|  format(...)\n|      Formats self with strftime.\n|\n|  ge(self, value, /)\n|      Return self>=value.\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  gt(self, value, /)\n|      Return self>value.\n|\n|  hash(self, /)\n|      Return hash(self).\n|\n|  le(self, value, /)\n|      Return self<=value.\n|\n|  lt(self, value, /)\n|      Return self<value.\n|\n|  ne(self, value, /)\n|      Return self!=value.\n|\n|  radd(self, value, /)\n|      Return value+self.\n|\n|  reduce(...)\n|      reduce() -> (cls, state)\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  rsub(self, value, /)\n|      Return value-self.\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  sub(self, value, /)\n|      Return self-value.\n|\n|  ctime(...)\n|      Return ctime() style string.\n|\n|  isocalendar(...)\n|      Return a named tuple containing ISO year, week number, and weekday.\n|\n|  isoformat(...)\n|      Return string in ISO 8601 format, YYYY-MM-DD.\n|\n|  isoweekday(...)\n|      Return the day of the week represented by the date.\n|      Monday == 1 ... Sunday == 7\n|\n|  replace(...)\n|      Return date with new specified fields.\n|\n|  strftime(...)\n|      format -> strftime() style string.\n|\n|  timetuple(...)\n|      Return time tuple, compatible with time.localtime().\n|\n|  toordinal(...)\n|      Return proleptic Gregorian ordinal.  January 1 of year 1 is day 1.\n|\n|  weekday(...)\n|      Return the day of the week represented by the date.\n|      Monday == 0 ... Sunday == 6\n|\n|  ----------------------------------------------------------------------\n|  Class methods defined here:\n|\n|  fromisocalendar(...) from builtins.type\n|      int, int, int -> Construct a date from the ISO year, week number and weekday.\n|\n|      This is the inverse of the date.isocalendar() function\n|\n|  fromisoformat(...) from builtins.type\n|      str -> Construct a date from the output of date.isoformat()\n|\n|  fromordinal(...) from builtins.type\n|      int -> date corresponding to a proleptic Gregorian ordinal.\n|\n|  fromtimestamp(timestamp, /) from builtins.type\n|      Create a date from a POSIX timestamp.\n|\n|      The timestamp is a number, e.g. created via time.time(), that is interpreted\n|      as local time.\n|\n|  today(...) from builtins.type\n|      Current date or datetime:  same as self.class.fromtimestamp(time.time()).\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  day\n|\n|  month\n|\n|  year\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  max = datetime.date(9999, 12, 31)\n|\n|  min = datetime.date(1, 1, 1)\n|\n|  resolution = datetime.timedelta(days=1)\n"
                },
                {
                    "name": "class datetime",
                    "content": "|  datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n|\n|  The year, month and day arguments are required. tzinfo may be None, or an\n|  instance of a tzinfo subclass. The remaining arguments may be ints.\n|\n|  Method resolution order:\n|      datetime\n|      date\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  add(self, value, /)\n|      Return self+value.\n|\n|  eq(self, value, /)\n|      Return self==value.\n|\n|  ge(self, value, /)\n|      Return self>=value.\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  gt(self, value, /)\n|      Return self>value.\n|\n|  hash(self, /)\n|      Return hash(self).\n|\n|  le(self, value, /)\n|      Return self<=value.\n|\n|  lt(self, value, /)\n|      Return self<value.\n|\n|  ne(self, value, /)\n|      Return self!=value.\n|\n|  radd(self, value, /)\n|      Return value+self.\n|\n|  reduce(...)\n|      reduce() -> (cls, state)\n|\n|  reduceex(...)\n|      reduceex(proto) -> (cls, state)\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  rsub(self, value, /)\n|      Return value-self.\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  sub(self, value, /)\n|      Return self-value.\n|\n|  astimezone(...)\n|      tz -> convert to local time in new timezone tz\n|\n|  ctime(...)\n|      Return ctime() style string.\n|\n|  date(...)\n|      Return date object with same year, month and day.\n|\n|  dst(...)\n|      Return self.tzinfo.dst(self).\n|\n|  isoformat(...)\n|      [sep] -> string in ISO 8601 format, YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].\n|      sep is used to separate the year from the time, and defaults to 'T'.\n|      The optional argument timespec specifies the number of additional terms\n|      of the time to include. Valid options are 'auto', 'hours', 'minutes',\n|      'seconds', 'milliseconds' and 'microseconds'.\n|\n|  replace(...)\n|      Return datetime with new specified fields.\n|\n|  time(...)\n|      Return time object with same time but with tzinfo=None.\n|\n|  timestamp(...)\n|      Return POSIX timestamp as float.\n|\n|  timetuple(...)\n|      Return time tuple, compatible with time.localtime().\n|\n|  timetz(...)\n|      Return time object with same time and tzinfo.\n|\n|  tzname(...)\n|      Return self.tzinfo.tzname(self).\n|\n|  utcoffset(...)\n|      Return self.tzinfo.utcoffset(self).\n|\n|  utctimetuple(...)\n|      Return UTC time tuple, compatible with time.localtime().\n|\n|  ----------------------------------------------------------------------\n|  Class methods defined here:\n|\n|  combine(...) from builtins.type\n|      date, time -> datetime with same date and time fields\n|\n|  fromisoformat(...) from builtins.type\n|      string -> datetime from datetime.isoformat() output\n|\n|  fromtimestamp(...) from builtins.type\n|      timestamp[, tz] -> tz's local time from POSIX timestamp.\n|\n|  now(tz=None) from builtins.type\n|      Returns new datetime object representing current time local to tz.\n|\n|        tz\n|          Timezone object.\n|\n|      If no tz is specified, uses local timezone.\n|\n|  strptime(...) from builtins.type\n|      string, format -> new datetime parsed from a string (like time.strptime()).\n|\n|  utcfromtimestamp(...) from builtins.type\n|      Construct a naive UTC datetime from a POSIX timestamp.\n|\n|  utcnow(...) from builtins.type\n|      Return a new datetime representing UTC day and time.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  fold\n|\n|  hour\n|\n|  microsecond\n|\n|  minute\n|\n|  second\n|\n|  tzinfo\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  max = datetime.datetime(9999, 12, 31, 23, 59, 59, 999999)\n|\n|  min = datetime.datetime(1, 1, 1, 0, 0)\n|\n|  resolution = datetime.timedelta(microseconds=1)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from date:\n|\n|  format(...)\n|      Formats self with strftime.\n|\n|  isocalendar(...)\n|      Return a named tuple containing ISO year, week number, and weekday.\n|\n|  isoweekday(...)\n|      Return the day of the week represented by the date.\n|      Monday == 1 ... Sunday == 7\n|\n|  strftime(...)\n|      format -> strftime() style string.\n|\n|  toordinal(...)\n|      Return proleptic Gregorian ordinal.  January 1 of year 1 is day 1.\n|\n|  weekday(...)\n|      Return the day of the week represented by the date.\n|      Monday == 0 ... Sunday == 6\n|\n|  ----------------------------------------------------------------------\n|  Class methods inherited from date:\n|\n|  fromisocalendar(...) from builtins.type\n|      int, int, int -> Construct a date from the ISO year, week number and weekday.\n|\n|      This is the inverse of the date.isocalendar() function\n|\n|  fromordinal(...) from builtins.type\n|      int -> date corresponding to a proleptic Gregorian ordinal.\n|\n|  today(...) from builtins.type\n|      Current date or datetime:  same as self.class.fromtimestamp(time.time()).\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from date:\n|\n|  day\n|\n|  month\n|\n|  year\n"
                },
                {
                    "name": "class time",
                    "content": "|  time([hour[, minute[, second[, microsecond[, tzinfo]]]]]) --> a time object\n|\n|  All arguments are optional. tzinfo may be None, or an instance of\n|  a tzinfo subclass. The remaining arguments may be ints.\n|\n|  Methods defined here:\n|\n|  eq(self, value, /)\n|      Return self==value.\n|\n|  format(...)\n|      Formats self with strftime.\n|\n|  ge(self, value, /)\n|      Return self>=value.\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  gt(self, value, /)\n|      Return self>value.\n|\n|  hash(self, /)\n|      Return hash(self).\n|\n|  le(self, value, /)\n|      Return self<=value.\n|\n|  lt(self, value, /)\n|      Return self<value.\n|\n|  ne(self, value, /)\n|      Return self!=value.\n|\n|  reduce(...)\n|      reduce() -> (cls, state)\n|\n|  reduceex(...)\n|      reduceex(proto) -> (cls, state)\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  dst(...)\n|      Return self.tzinfo.dst(self).\n|\n|  isoformat(...)\n|      Return string in ISO 8601 format, [HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].\n|\n|      The optional argument timespec specifies the number of additional terms\n|      of the time to include. Valid options are 'auto', 'hours', 'minutes',\n|      'seconds', 'milliseconds' and 'microseconds'.\n|\n|  replace(...)\n|      Return time with new specified fields.\n|\n|  strftime(...)\n|      format -> strftime() style string.\n|\n|  tzname(...)\n|      Return self.tzinfo.tzname(self).\n|\n|  utcoffset(...)\n|      Return self.tzinfo.utcoffset(self).\n|\n|  ----------------------------------------------------------------------\n|  Class methods defined here:\n|\n|  fromisoformat(...) from builtins.type\n|      string -> time from time.isoformat() output\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  fold\n|\n|  hour\n|\n|  microsecond\n|\n|  minute\n|\n|  second\n|\n|  tzinfo\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  max = datetime.time(23, 59, 59, 999999)\n|\n|  min = datetime.time(0, 0)\n|\n|  resolution = datetime.timedelta(microseconds=1)\n"
                },
                {
                    "name": "class timedelta",
                    "content": "|  Difference between two datetime values.\n|\n|  timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)\n|\n|  All arguments are optional and default to 0.\n|  Arguments may be integers or floats, and may be positive or negative.\n|\n|  Methods defined here:\n|\n|  abs(self, /)\n|      abs(self)\n|\n|  add(self, value, /)\n|      Return self+value.\n|\n|  bool(self, /)\n|      True if self else False\n|\n|  divmod(self, value, /)\n|      Return divmod(self, value).\n|\n|  eq(self, value, /)\n|      Return self==value.\n|\n|  floordiv(self, value, /)\n|      Return self//value.\n|\n|  ge(self, value, /)\n|      Return self>=value.\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  gt(self, value, /)\n|      Return self>value.\n|\n|  hash(self, /)\n|      Return hash(self).\n|\n|  le(self, value, /)\n|      Return self<=value.\n|\n|  lt(self, value, /)\n|      Return self<value.\n|\n|  mod(self, value, /)\n|      Return self%value.\n|\n|  mul(self, value, /)\n|      Return self*value.\n|\n|  ne(self, value, /)\n|      Return self!=value.\n|\n|  neg(self, /)\n|      -self\n|\n|  pos(self, /)\n|      +self\n|\n|  radd(self, value, /)\n|      Return value+self.\n|\n|  rdivmod(self, value, /)\n|      Return divmod(value, self).\n|\n|  reduce(...)\n|      reduce() -> (cls, state)\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  rfloordiv(self, value, /)\n|      Return value//self.\n|\n|  rmod(self, value, /)\n|      Return value%self.\n|\n|  rmul(self, value, /)\n|      Return value*self.\n|\n|  rsub(self, value, /)\n|      Return value-self.\n|\n|  rtruediv(self, value, /)\n|      Return value/self.\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  sub(self, value, /)\n|      Return self-value.\n|\n|  truediv(self, value, /)\n|      Return self/value.\n|\n|  totalseconds(...)\n|      Total seconds in the duration.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  days\n|      Number of days.\n|\n|  microseconds\n|      Number of microseconds (>= 0 and less than 1 second).\n|\n|  seconds\n|      Number of seconds (>= 0 and less than 1 day).\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  max = datetime.timedelta(days=999999999, seconds=86399, microseconds=9...\n|\n|  min = datetime.timedelta(days=-999999999)\n|\n|  resolution = datetime.timedelta(microseconds=1)\n"
                },
                {
                    "name": "class timezone",
                    "content": "|  Fixed offset from UTC implementation of tzinfo.\n|\n|  Method resolution order:\n|      timezone\n|      tzinfo\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  eq(self, value, /)\n|      Return self==value.\n|\n|  ge(self, value, /)\n|      Return self>=value.\n|\n|  getinitargs(...)\n|      pickle support\n|\n|  gt(self, value, /)\n|      Return self>value.\n|\n|  hash(self, /)\n|      Return hash(self).\n|\n|  le(self, value, /)\n|      Return self<=value.\n|\n|  lt(self, value, /)\n|      Return self<value.\n|\n|  ne(self, value, /)\n|      Return self!=value.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  dst(...)\n|      Return None.\n|\n|  fromutc(...)\n|      datetime in UTC -> datetime in local time.\n|\n|  tzname(...)\n|      If name is specified when timezone is created, returns the name.  Otherwise returns offset as 'UTC(+|-)HH:MM'.\n|\n|  utcoffset(...)\n|      Return fixed offset.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  max = datetime.timezone(datetime.timedelta(seconds=86340))\n|\n|  min = datetime.timezone(datetime.timedelta(days=-1, seconds=60))\n|\n|  utc = datetime.timezone.utc\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from tzinfo:\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      -> (cls, state)\n"
                },
                {
                    "name": "class tzinfo",
                    "content": "|  Abstract base class for time zone info objects.\n|\n|  Methods defined here:\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      -> (cls, state)\n|\n|  dst(...)\n|      datetime -> DST offset as timedelta positive east of UTC.\n|\n|  fromutc(...)\n|      datetime in UTC -> datetime in local time.\n|\n|  tzname(...)\n|      datetime -> string name of time zone.\n|\n|  utcoffset(...)\n|      datetime -> timedelta showing offset from UTC, negative values indicating West of UTC\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n"
                }
            ]
        },
        "DATA": {
            "content": "MAXYEAR = 9999\nMINYEAR = 1\nall = ('date', 'datetime', 'time', 'timedelta', 'timezone', 'tzinf...\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3.10/datetime.py\n\n",
            "subsections": []
        }
    },
    "summary": "datetime - Fast implementation of the datetime type.",
    "flags": [],
    "examples": [],
    "see_also": []
}