Date, time

Overview

Functions to operate the date and time. More…

// global functions

char* te_time_current_date2str(void);
te_errno te_gettimeofday(struct timeval* tv, struct timezone* tz);
void te_timersub(const struct timeval* a, const struct timeval* b, struct timeval* res);

Detailed Documentation

Functions to operate the date and time.

Copyright (C) 2004-2022 OKTET Labs Ltd. All rights reserved.

Global Functions

char* te_time_current_date2str(void)

Get string representation of the current date.

Return value should be freed with free(3) when it is no longer needed.

Returns:

Current date, or NULL in case of failure.

te_errno te_gettimeofday(struct timeval* tv, struct timezone* tz)

Wrapper over gettimeofday() reporting error in TE format.

Parameters:

tv

Pointer to timeval structure.

tz

Pointer to timezone structure (may be NULL).

Returns:

Status code.

void te_timersub(const struct timeval* a, const struct timeval* b, struct timeval* res)

Subtract the time value in b from the time value in a, and place the result in the timeval pointed to by res

It is an alternative to BSD timersub()

Parameters:

a

Minuend

b

Subtrahend

res

Difference