>>>> Is there any way to check whether daylight saving is enabled on a
linux machine?
This is not related to c.l.c.
man timezone will help!!
Can you not check the tm_isdst member of the struct tm returned by
localtime(const time_t *tp)?
Could you please quote the standard about localtime? I wish to compare
it with my (linux) man page for localtime.
7.23 Date and time <time.h>
7.23.1 Components of time
4 The range and precision of times representable in clock_t and time_t
are implementation-defined. The tm structure shall contain at least the
following members, in any order. The semantics of the members and their
normal ranges are expressed in the comments.
int tm_sec; // seconds after the minute [0, 60]
int tm_min; // minutes after the hour [0, 59]
int tm_hour; // hours since midnight [0, 23]
int tm_mday; // day of the month [1, 31]
int tm_mon; // months since January [0, 11]
int tm_year; // years since 1900
int tm_wday; // days since Sunday [0, 6]
int tm_yday; // days since January 1 [0, 365]
int tm_isdst; // Daylight Saving Time flag
The value of tm_isdst is positive if Daylight Saving Time is in effect,
zero if Daylight Saving Time is not in effect, and negative if the
information is not available.
.....
7.23.3.4 The localtime function
Synopsis 1
#include <time.h> struct tm *localtime(cons t time_t *timer);
Description 2 The localtime function converts the calendar time pointed
to by timer into a broken-down time, expressed as local time.
Returns 3 The localtime function returns a pointer to the broken-down
time, or a null pointer if the specified time cannot be converted to
local time.
Cheers
Michael