summaryrefslogtreecommitdiff
path: root/Include
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2016-09-28 17:31:35 -0400
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2016-09-28 17:31:35 -0400
commitada5f796e97b5a38b43571134f846366876ae54d (patch)
treeda22ca57fe1c7dbbd30d2e26a2e449c6504967a5 /Include
parenta715e303f3c1614cfeac410898df995e06dd42df (diff)
downloadcpython-ada5f796e97b5a38b43571134f846366876ae54d.tar.gz
Issue #28148: Stop using localtime() and gmtime() in the time module.
Introduced platform independent _PyTime_localtime API that is similar to POSIX localtime_r, but available on all platforms. Patch by Ed Schouten.
Diffstat (limited to 'Include')
-rw-r--r--Include/pytime.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Include/pytime.h b/Include/pytime.h
index 595fafc5c0..87ac7fcbba 100644
--- a/Include/pytime.h
+++ b/Include/pytime.h
@@ -184,6 +184,14 @@ PyAPI_FUNC(int) _PyTime_GetMonotonicClockWithInfo(
Return 0 on success, raise an exception and return -1 on error. */
PyAPI_FUNC(int) _PyTime_Init(void);
+/* Converts a timestamp to the Gregorian time, using the local time zone.
+ Return 0 on success, raise an exception and return -1 on error. */
+PyAPI_FUNC(int) _PyTime_localtime(time_t t, struct tm *tm);
+
+/* Converts a timestamp to the Gregorian time, assuming UTC.
+ Return 0 on success, raise an exception and return -1 on error. */
+PyAPI_FUNC(int) _PyTime_gmtime(time_t t, struct tm *tm);
+
#ifdef __cplusplus
}
#endif