get_time_setting

 

Description

Get time settings related variable values.

Syntax

void get_time_setting( int * pdaylight, long * ptimezone, char * tzname[2] )

Parameters

pdaylight
[output] Pointer to a Integer value indicating the daylight settting. Nonzero if daylight-saving-time zone (DST) is specified in TZ; otherwise, 0. Default value is 1.
ptimezone
[output] Pointer to a Integer value indicating the timezone setting. Difference in seconds between coordinated universal time and local time. Default value is 28,800.
tzname
[output] Pointer to a buffer to store the timezone name. tzname[0]: Time-zone name derived from TZ environment variable. tzname[1]: DST zone name derived from TZ environment variable. Default value is PDT (Pacific daylight time). If DST zone is omitted from TZ, tzname[1] is empty string.

Return

Examples

EX1

#include <origin.h>
void get_time_setting_ex1()
{
    _tzset();

    int daylight;
    long timezone;
    char* tzname[2];
    get_time_setting(&daylight, &timezone, tzname);
    printf( "daylight = %d\n", daylight );
    printf( "timezone = %ld\n", timezone );
    printf( "tzname[0] = %s\n", tzname[0] );
    printf( "tzname[1] = %s\n", tzname[1] );
}

Remark

See Also

_tzset

header to Include

origin.h

Reference