Is it possible to get localtime (or mktime) from time.h to get you the year day/hour/min/sec wthout the effects of daylight savings? That is, with only using the standard c library.. or anything cross platform..
Is it possible to get localtime (or mktime) from time.h to get you the year day/hour/min/sec wthout the effects of daylight savings? That is, with only using the standard c library.. or anything cross platform..
apologies, found the answer myself. DST shifts forward by one hour, so if tm_isdst is 1, then you just have to minus the tm_hour by one. I hope I'm right..
> DST shifts forward by one hour
Not always an hour, but oh well. This is "overlooked" in the standard.
Really? I hope it's not too common for it to be more than one hour..
Is it possible to get just the timezone information then? curses to whoever invented DST..
p.s g'day (or good night) to you mate, I'm from Australia as well
I never realized it could be something other than one hour.
Wow... since you're from Australia you might appreciate this...
Clock shifts are usually scheduled near a weekend midnight to lessen disruption to weekday schedules. A one-hour shift is customary, but Australia's Lord Howe Island uses a half-hour shift.[25] Twenty-minute and two-hour shifts have been used in the past.
( Daylight saving time - Wikipedia, the free encyclopedia )
That tm_isdst is just a flag, set if DST is in effect or cleared if it isn't. Here's what the man page has to say about it
Code:The value of tm_isdst shall be positive if Daylight Savings Time is in effect, 0 if Daylight Savings Time is not in effect, and negative if the information is not available.