blob: a9d26a77a12e76ae83e0b54a782198441ee3522d [file] [log] [blame]
Tim Peters1b6f7a92004-06-20 02:50:16 +00001/* timefuncs.h
2 */
3
4/* Utility function related to timemodule.c. */
5
6#ifndef TIMEFUNCS_H
7#define TIMEFUNCS_H
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12
13/* Cast double x to time_t, but raise ValueError if x is too large
14 * to fit in a time_t. ValueError is set on return iff the return
15 * value is (time_t)-1 and PyErr_Occurred().
16 */
17PyAPI_FUNC(time_t) _PyTime_DoubleToTimet(double x);
18
Kristján Valur Jónsson868f0aa2013-03-19 13:53:56 -070019/* Get the current time since the epoch in seconds */
20PyAPI_FUNC(double) _PyTime_FloatTime(void);
21
Tim Peters1b6f7a92004-06-20 02:50:16 +000022
23#ifdef __cplusplus
24}
25#endif
26#endif /* TIMEFUNCS_H */