posix_time.h

All headers

Time functions.

  1. OPENSSL_posix_to_tm
  2. OPENSSL_tm_to_posix
  3. OPENSSL_timegm

OPENSSL_posix_to_tm converts a int64_t POSIX time value in time, which must be in the range of year 0000 to 9999, to a broken out time value in tm. It returns one on success and zero on error.

OPENSSL_EXPORT int OPENSSL_posix_to_tm(int64_t time, struct tm *out_tm);

OPENSSL_tm_to_posix converts a time value between the years 0 and 9999 in tm to a POSIX time value in out. One is returned on success, zero is returned on failure. It is a failure if tm contains out of range values.

OPENSSL_EXPORT int OPENSSL_tm_to_posix(const struct tm *tm, int64_t *out);

OPENSSL_timegm converts a time value between the years 0 and 9999 in tm to a time_t value in out. One is returned on success, zero is returned on failure. It is a failure if the converted time can not be represented in a time_t, or if the tm contains out of range values.

OPENSSL_EXPORT int OPENSSL_timegm(const struct tm *tm, time_t *out);