@classmethod
def strptime(cls, date_string, format):
- """Parse string according to the given date format (like time.strptime())."""
+ """Parse string according to the given date format (like time.strptime()).
+
+ For a list of supported format codes, see the documentation:
+ https://docs.python.org/3/library/datetime.html#format-codes
+ """
import _strptime
return _strptime._strptime_datetime_date(cls, date_string, format)
Format using strftime().
Example: "%d/%m/%Y, %H:%M:%S"
+ For a list of supported format codes, see the documentation:
+ https://docs.python.org/3/library/datetime.html#format-codes
"""
return _wrap_strftime(self, format, self.timetuple())
return self
@classmethod
+
def strptime(cls, date_string, format):
- """Parse string according to the given time format (like time.strptime())."""
+ """Parse string according to the given time format (like time.strptime()).
+
+ For a list of supported format codes, see the documentation:
+ https://docs.python.org/3/library/datetime.html#format-codes
+ """
import _strptime
return _strptime._strptime_datetime_time(cls, date_string, format)
def strftime(self, format):
"""Format using strftime(). The date part of the timestamp passed
to underlying strftime should not be used.
+
+ For a list of supported format codes, see the documentation:
+ https://docs.python.org/3/library/datetime.html#format-codes
"""
# The year must be >= 1000 else Python's strftime implementation
# can raise a bogus exception.
@classmethod
def strptime(cls, date_string, format):
- """Parse string according to the given date and time format (like time.strptime())."""
+ """Parse string according to the given time format (like time.strptime()).
+
+ For a list of supported format codes, see the documentation:
+ https://docs.python.org/3/library/datetime.html#format-codes
+ """
import _strptime
return _strptime._strptime_datetime_datetime(cls, date_string, format)
/
Parse string according to the given date format (like time.strptime()).
+
+For a list of supported format codes, see the documentation:
+ https://docs.python.org/3/library/datetime.html#format-codes
[clinic start generated code]*/
static PyObject *
datetime_date_strptime_impl(PyTypeObject *type, PyObject *string,
PyObject *format)
-/*[clinic end generated code: output=454d473bee2d5161 input=001904ab34f594a1]*/
+/*[clinic end generated code: output=454d473bee2d5161 input=31d57bb789433e99]*/
{
PyObject *result;
Format using strftime().
Example: "%d/%m/%Y, %H:%M:%S".
+
+For a list of supported format codes, see the documentation:
+ https://docs.python.org/3/library/datetime.html#format-codes
[clinic start generated code]*/
static PyObject *
datetime_date_strftime_impl(PyObject *self, PyObject *format)
-/*[clinic end generated code: output=6529b70095e16778 input=72af55077e606ed8]*/
+/*[clinic end generated code: output=6529b70095e16778 input=b6fd4a2ded27b557]*/
{
/* This method can be inherited, and needs to call the
* timetuple() method appropriate to self's class.
/
Parse string according to the given time format (like time.strptime()).
+
+For a list of supported format codes, see the documentation:
+ https://docs.python.org/3/library/datetime.html#format-codes
[clinic start generated code]*/
static PyObject *
datetime_time_strptime_impl(PyTypeObject *type, PyObject *string,
PyObject *format)
-/*[clinic end generated code: output=ae05a9bc0241d3bf input=6d0f263a5f94d78d]*/
+/*[clinic end generated code: output=ae05a9bc0241d3bf input=82ba425ecacc54aa]*/
{
PyObject *result;
Format using strftime().
The date part of the timestamp passed to underlying strftime should not be used.
+
+For a list of supported format codes, see the documentation:
+ https://docs.python.org/3/library/datetime.html#format-codes
[clinic start generated code]*/
static PyObject *
datetime_time_strftime_impl(PyDateTime_Time *self, PyObject *format)
-/*[clinic end generated code: output=10f65af20e2a78c7 input=541934a2860f7db5]*/
+/*[clinic end generated code: output=10f65af20e2a78c7 input=c4a5bbecd798654b]*/
{
PyObject *result;
PyObject *tuple;
/
Parse string according to the given date and time format (like time.strptime()).
+
+For a list of supported format codes, see the documentation:
+ https://docs.python.org/3/library/datetime.html#format-codes
[clinic start generated code]*/
static PyObject *
datetime_datetime_strptime_impl(PyTypeObject *type, PyObject *string,
PyObject *format)
-/*[clinic end generated code: output=af2c2d024f3203f5 input=d7597c7f5327117b]*/
+/*[clinic end generated code: output=af2c2d024f3203f5 input=ef7807589f1d50e7]*/
{
PyObject *result;
"strptime($type, string, format, /)\n"
"--\n"
"\n"
-"Parse string according to the given date format (like time.strptime()).");
+"Parse string according to the given date format (like time.strptime()).\n"
+"\n"
+"For a list of supported format codes, see the documentation:\n"
+" https://docs.python.org/3/library/datetime.html#format-codes");
#define DATETIME_DATE_STRPTIME_METHODDEF \
{"strptime", _PyCFunction_CAST(datetime_date_strptime), METH_FASTCALL|METH_CLASS, datetime_date_strptime__doc__},
"\n"
"Format using strftime().\n"
"\n"
-"Example: \"%d/%m/%Y, %H:%M:%S\".");
+"Example: \"%d/%m/%Y, %H:%M:%S\".\n"
+"\n"
+"For a list of supported format codes, see the documentation:\n"
+" https://docs.python.org/3/library/datetime.html#format-codes");
#define DATETIME_DATE_STRFTIME_METHODDEF \
{"strftime", _PyCFunction_CAST(datetime_date_strftime), METH_FASTCALL|METH_KEYWORDS, datetime_date_strftime__doc__},
"strptime($type, string, format, /)\n"
"--\n"
"\n"
-"Parse string according to the given time format (like time.strptime()).");
+"Parse string according to the given time format (like time.strptime()).\n"
+"\n"
+"For a list of supported format codes, see the documentation:\n"
+" https://docs.python.org/3/library/datetime.html#format-codes");
#define DATETIME_TIME_STRPTIME_METHODDEF \
{"strptime", _PyCFunction_CAST(datetime_time_strptime), METH_FASTCALL|METH_CLASS, datetime_time_strptime__doc__},
"\n"
"Format using strftime().\n"
"\n"
-"The date part of the timestamp passed to underlying strftime should not be used.");
+"The date part of the timestamp passed to underlying strftime should not be used.\n"
+"\n"
+"For a list of supported format codes, see the documentation:\n"
+" https://docs.python.org/3/library/datetime.html#format-codes");
#define DATETIME_TIME_STRFTIME_METHODDEF \
{"strftime", _PyCFunction_CAST(datetime_time_strftime), METH_FASTCALL|METH_KEYWORDS, datetime_time_strftime__doc__},
"strptime($type, string, format, /)\n"
"--\n"
"\n"
-"Parse string according to the given date and time format (like time.strptime()).");
+"Parse string according to the given date and time format (like time.strptime()).\n"
+"\n"
+"For a list of supported format codes, see the documentation:\n"
+" https://docs.python.org/3/library/datetime.html#format-codes");
#define DATETIME_DATETIME_STRPTIME_METHODDEF \
{"strptime", _PyCFunction_CAST(datetime_datetime_strptime), METH_FASTCALL|METH_CLASS, datetime_datetime_strptime__doc__},
{
return datetime_datetime___reduce___impl((PyDateTime_DateTime *)self);
}
-/*[clinic end generated code: output=0b8403bc58982e60 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=69658acff6a43ac4 input=a9049054013a1b77]*/