diff options
Diffstat (limited to 'src/nvim/os/time.c')
-rw-r--r-- | src/nvim/os/time.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/os/time.c b/src/nvim/os/time.c index 5cf628935f..e7e0dc4013 100644 --- a/src/nvim/os/time.c +++ b/src/nvim/os/time.c @@ -196,6 +196,22 @@ char *os_ctime(char *result, size_t result_len) return os_ctime_r(&rawtime, result, result_len); } +/// Portable version of POSIX strptime() +/// +/// @param str[in] string to convert +/// @param format[in] format to parse "str" +/// @param tm[out] time representation of "str" +/// @return Pointer to first unprocessed character or NULL +char *os_strptime(const char *str, const char *format, struct tm *tm) + FUNC_ATTR_NONNULL_ALL +{ +#ifdef HAVE_STRPTIME + return strptime(str, format, tm); +#else + return NULL; +#endif +} + /// Obtains the current Unix timestamp. /// /// @return Seconds since epoch. |