aboutsummaryrefslogtreecommitdiff
path: root/src/os/time.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/time.h')
-rw-r--r--src/os/time.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/os/time.h b/src/os/time.h
index 42feaa3eba..ef795d03be 100644
--- a/src/os/time.h
+++ b/src/os/time.h
@@ -19,6 +19,17 @@ void os_delay(uint64_t milliseconds, bool ignoreinput);
/// @param ignoreinput If true, allow a SIGINT to interrupt us
void os_microdelay(uint64_t microseconds, bool ignoreinput);
+/// Portable version of POSIX localtime_r()
+///
+/// @return NULL in case of error
+struct tm *os_localtime_r(const time_t *clock, struct tm *result);
+
+/// Obtains the current UNIX timestamp and adjusts it to local time
+///
+/// @param result Pointer to a 'struct tm' where the result should be placed
+/// @return A pointer to a 'struct tm' in the current time zone (the 'result'
+/// argument) or NULL in case of error
+struct tm *os_get_localtime(struct tm *result);
#endif // NEOVIM_OS_TIME_H