Time structure (struct tm) contains a calendar date and time broken down into its components. The structure contains nine members of type int (in any order), which are:
Member Type Meaning Range
tm_sec int seconds after the minute 0-61*
tm_min int minutes after the hour 0-59
tm_hour int hours since midnight 0-23
tm_mday int day of the month 1-31
tm_mon int months since January 0-11
tm_year int years since 1900
tm_wday int days since Sunday 0-6
tm_yday int days since January 1 0-365
tm_isdst int Daylight Saving Time flag
The Daylight Saving Time flag (tm_isdst) is greater than zero if Daylight Saving Time is in effect, zero if Daylight Saving Time is not in effect, and less than zero if the information is not available.
My Specific Questions related to tm_isdst are as follows:
For date(YYYY-MM-DD) 2016-03-16 (when DST is in effect), should tm_isdst be 1? or 0?
For date(YYYY-MM-DD) 2016-01-16 (when DST was not in effect), should tm_isdst be 1? or 0?
Daylight Saving Time (United States) 2016 began at 2:00 AM on Sunday, March 13. So at say 1:45AM on March 13, what would be value of tm_isdst? Who sets this value of flag and how?
Is there any way to check when DST was in effect from some system call?