utc - Is gmtime() affected by daylight savings? -
my local time zone edt. have time stamp: 29 aug 2003 04:18:52, have converted time_t value using mktime(), tm_isdst set -1. time_t value 1062145132. when run gmtime() value, 29 aug 2003 09:18:52. looking @ struct tm returned gmtime(), value of tm_isdst 1. why isn't time 08:18:52 instead? isn't gmtime supposed equivalent utc, without daylight savings dependence?
i have used bash follows:
date --date=@1062145132 fri aug 29 04:18:52 edt 2003 tz=utc date --date=@1062145132 fri aug 29 08:18:52 utc 2003
the above shows expected 4 hour difference between edt , utc. why doesn't gmtime() show same difference?
i found problem. in between call gmtime(&tmgmt) , output of asctime(&tmgmt), had call mktime(&tmgmt). had not realized mktime possibly change values in structure, values printed out not returned gmtime().