PythonMonkey   v1.0.0 (dev)
Loading...
Searching...
No Matches
DateType.hh
Go to the documentation of this file.
1
11#ifndef PythonMonkey_DateType_
12#define PythonMonkey_DateType_
13
14#include <jsapi.h>
15#include <js/Date.h>
16
17#include <Python.h>
18
22struct DateType {
23public:
27 static PyObject *getPyObject(JSContext *cx, JS::HandleObject dateObj);
28
35 static JSObject *toJsDate(JSContext *cx, PyObject *pyObject);
36};
37
38#endif
This struct represents the 'datetime' type in Python from the datetime module, which is represented a...
Definition DateType.hh:22
static PyObject * getPyObject(JSContext *cx, JS::HandleObject dateObj)
Convert a JS Date object to Python datetime.
Definition DateType.cc:18
static JSObject * toJsDate(JSContext *cx, PyObject *pyObject)
Convert a Python datetime object to JS Date.
Definition DateType.cc:50