Serhiy Storchaka | 1009bf1 | 2015-04-03 23:53:51 +0300 | [diff] [blame] | 1 | /*[clinic input] |
| 2 | preserve |
| 3 | [clinic start generated code]*/ |
| 4 | |
| 5 | PyDoc_STRVAR(datetime_datetime_now__doc__, |
| 6 | "now($type, /, tz=None)\n" |
| 7 | "--\n" |
| 8 | "\n" |
| 9 | "Returns new datetime object representing current time local to tz.\n" |
| 10 | "\n" |
| 11 | " tz\n" |
| 12 | " Timezone object.\n" |
| 13 | "\n" |
| 14 | "If no tz is specified, uses local timezone."); |
| 15 | |
| 16 | #define DATETIME_DATETIME_NOW_METHODDEF \ |
| 17 | {"now", (PyCFunction)datetime_datetime_now, METH_VARARGS|METH_KEYWORDS|METH_CLASS, datetime_datetime_now__doc__}, |
| 18 | |
| 19 | static PyObject * |
| 20 | datetime_datetime_now_impl(PyTypeObject *type, PyObject *tz); |
| 21 | |
| 22 | static PyObject * |
| 23 | datetime_datetime_now(PyTypeObject *type, PyObject *args, PyObject *kwargs) |
| 24 | { |
| 25 | PyObject *return_value = NULL; |
| 26 | static char *_keywords[] = {"tz", NULL}; |
| 27 | PyObject *tz = Py_None; |
| 28 | |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 29 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O:now", _keywords, |
Serhiy Storchaka | 1009bf1 | 2015-04-03 23:53:51 +0300 | [diff] [blame] | 30 | &tz)) |
| 31 | goto exit; |
| 32 | return_value = datetime_datetime_now_impl(type, tz); |
| 33 | |
| 34 | exit: |
| 35 | return return_value; |
| 36 | } |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 37 | /*[clinic end generated code: output=7f45c670d6e4953a input=a9049054013a1b77]*/ |