summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-30 19:36:10 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-03-30 19:36:10 (GMT)
commitfa09beb1508f782b51ba0a2815c07e0294f40e95 (patch)
tree6215208a85dae67128419b939aceb12ba92c2adf /Include
parent749a6a85c645648199eb4e855a9537a8b703ffeb (diff)
downloadcpython-fa09beb1508f782b51ba0a2815c07e0294f40e95.zip
cpython-fa09beb1508f782b51ba0a2815c07e0294f40e95.tar.gz
cpython-fa09beb1508f782b51ba0a2815c07e0294f40e95.tar.bz2
Issue #23485: Add _PyTime_FromMillisecondsObject() function
Diffstat (limited to 'Include')
-rw-r--r--Include/pytime.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/Include/pytime.h b/Include/pytime.h
index 1f14d6d..bf237c8 100644
--- a/Include/pytime.h
+++ b/Include/pytime.h
@@ -69,12 +69,18 @@ PyAPI_FUNC(int) _PyTime_ObjectToTimespec(
/* Create a timestamp from a number of nanoseconds (C long). */
PyAPI_FUNC(_PyTime_t) _PyTime_FromNanoseconds(PY_LONG_LONG ns);
-/* Convert a Python float or int to a timetamp.
+/* Convert a number of seconds (Python float or int) to a timetamp.
Raise an exception and return -1 on error, return 0 on success. */
PyAPI_FUNC(int) _PyTime_FromSecondsObject(_PyTime_t *t,
PyObject *obj,
_PyTime_round_t round);
+/* Convert a number of milliseconds (Python float or int, 10^-3) to a timetamp.
+ Raise an exception and return -1 on error, return 0 on success. */
+PyAPI_FUNC(int) _PyTime_FromMillisecondsObject(_PyTime_t *t,
+ PyObject *obj,
+ _PyTime_round_t round);
+
/* Convert a timestamp to a number of seconds as a C double. */
PyAPI_FUNC(double) _PyTime_AsSecondsDouble(_PyTime_t t);