我看到很多不同的意见,所以想到在这里问.
我读了man mktime:
(A positive or zero value for tm_isdst causes mktime() to presume initially that summer time (for example,Daylight Saving Time) is or is not in effect for the specified time,respectively. A negative value for tm_isdst causes the mktime() function to attempt to divine whether summer time is in effect for the specified time.
我的问题是,不应该将tm_isdst保持为-1,让系统决定其是否为dst,并且代码变得无关紧要?
我错过了什么吗?