Lines Matching defs:format

1427  * String format helpers.
1533 * format, we have to double any % signs so that
1534 * strftime doesn't treat them as format codes.
1569 * giving special meanings to the %z, %Z and %f format codes via a
1570 * preprocessing step on the format string.
1575 wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
1584 const char *pin; /* pointer to next char in input format */
1585 Py_ssize_t flen; /* length of input format */
1586 char ch; /* next char in input format */
1588 PyObject *newfmt = NULL; /* py string, the output format */
1589 char *pnew; /* pointer to available byte in output format */
1590 size_t totalnew; /* number bytes total in output format buffer,
1592 size_t usednew; /* number bytes used so far in output format buffer */
1597 assert(object && format && timetuple);
1598 assert(PyUnicode_Check(format));
1599 /* Convert the input format to a C string and size */
1600 pin = PyUnicode_AsUTF8AndSize(format, &flen);
1604 /* Scan the input format, looking for %z/%Z/%f escapes, building
1605 * a new format. Since computing the replacements for those codes
1636 /* format utcoffset */
1662 /* format tzname */
1677 /* format microseconds */
1695 * the new format.
1720 PyObject *format;
1725 format = PyUnicode_FromString(PyBytes_AS_STRING(newfmt));
1726 if (format != NULL) {
1728 format, timetuple, NULL);
1729 Py_DECREF(format);
3258 PyObject *format;
3260 static char *keywords[] = {"format", NULL};
3263 &format))
3269 result = wrap_strftime((PyObject *)self, format, tuple,
3278 PyObject *format;
3280 if (!PyArg_ParseTuple(args, "U:__format__", &format))
3283 /* if the format is zero length, return str(self) */
3284 if (PyUnicode_GetLength(format) == 0)
3288 format);
3568 PyDoc_STR("str -> Construct a date from a string in ISO 8601 format.")},
3586 PyDoc_STR("format -> strftime() style string.")},
3599 PyDoc_STR("Return string in ISO 8601 format, YYYY-MM-DD.")},
4436 PyObject *format;
4437 static char *keywords[] = {"format", NULL};
4440 &format))
4456 result = wrap_strftime((PyObject *)self, format, tuple,
4644 // T, but the extended format allows this to be omitted as long as there
4732 PyDoc_STR("Return string in ISO 8601 format, [HH[:MM[:SS[.mmm[uuu]]]]]"
4740 PyDoc_STR("format -> strftime() style string.")},
4758 PyDoc_STR("string -> time from a string in ISO 8601 format")},
5224 PyObject *string, *format;
5227 if (!PyArg_ParseTuple(args, "UU:strptime", &string, &format))
5236 cls, string, format, NULL);
5289 // Depending on the format of the string, the separator can only ever be
6542 PyDoc_STR("string, format -> new datetime parsed from a string "
6577 PyDoc_STR("[sep] -> string in ISO 8601 format, "