Time.h functions

Macros | Functions
Time.h functions
Evil

This header provides functions ported from Unix in time.h. More...

## Macros
#define | HAVE_GETTIMEOFDAY 1

## Functions
EVIL_API int | evil_gettimeofday (struct timeval *tv, struct timezone *tz)
| Get time and timezone. More...
EVIL_API char * | strptime (const char *buf, const char *fmt, struct tm *tm)
| Convert a string representation of time to a time tm structure . More...

## Detailed Description

This header provides functions ported from Unix in time.h.

## Function Documentation

## ◆ evil_gettimeofday()

EVIL_API int evil_gettimeofday | ( | struct timeval * | tv,
|  | struct timezone * | tz
| ) |  |

Get time and timezone.

Parameters

  tv | A pointer that contains two sockets.
  tz | A pointer that contains two sockets.

Returns
  0 on success, -1 otherwise.

This function gets the time and timezone. `tv` and `tz` can be `NULL`. It calls GetSystemTimePreciseAsFileTime() on Windows 8or above if _WIN32_WINNT is correctly defined. It returns 0 on success, -1 otherwise.

Since
  1.25

## ◆ strptime()

EVIL_API char* strptime | ( | const char * | buf,
|  | const char * | fmt,
|  | struct tm * | tm
| ) |  |

Convert a string representation of time to a time tm structure .

Parameters

  buf | The string to convert.
  fmt | The representation of time.
  tm | The time tm structure.

Returns
  The first character not processed in this function call.

This function converts the string `s` to a time tm structure and fill the buffer `tm`. The format of the time is specified by `format`. On success, this function returns the first character not processed in this function call, `NULL` otherwise.

Conformity: Non applicable.

Supported OS: Windows XP.

Referenced by eina_value_util_time_string_new().