如何确定夏令时在C中是否处于活动状态?

Fer*_*Fer 5 c dst

我有一个在跨平台上运行的C应用程序。在此程序中,我需要编写一个函数来确定给定日期是否为夏令时。
实际上,我尝试在纯C中找到DST开始-DST结束日期。是否有任何简单且标准的方法来做到这一点?

pmr*_*pmr 6

time.h提供tm带有tm_isdst标志的结构。使用time以获取当前时间,localtime以获得tm与调整到当前区域设置的时间结构和阅读的tm_isdst标志。

从联机帮助页:

tm_isdst  A flag that indicates whether daylight saving time is in effect at the
time described.  The value is positive if daylight saving time is in effect, zero 
if it is not, and negative if the information is not available.
Run Code Online (Sandbox Code Playgroud)