timegm()

QNX SDP8.0C Library ReferenceAPIDeveloper

Convert a broken-down time to calendar time

Synopsis:

#include <time.h>

time_t timegm( struct tm* tp );

Arguments:

tp
A pointer to a tm structure that contains the time that you want to convert.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The timegm() function converts the broken-down time that tp points to into a calendar time, expressed as Coordinated Universal Time (UTC) (formerly known as Greenwich Mean Time or GMT).

This function is similar to mktime(), except that it interprets the input time as UTC rather than local time.

You typically use the date command to set the computer's internal clock using Coordinated Universal Time (UTC).

Returns:

The converted calendar time, or -1 if an error occurs.

Classification:

BSD, Linux

Safety:
Cancellation point No
Signal handler No
Thread Yes
Page updated: