Page 1 of 1

Daylight or standard time

Posted: Mon Jan 11, 2016 8:03 pm
by bwolfsohn
I'm drawing a blank here...

when displaying the time, i'd like to also display whether it's daylight standard time or daylight savings time.

there's a windows function that will return that, but i have never done wrappers for that...

https://msdn.microsoft.com/en-us/librar ... 2147217396

DWORD WINAPI GetDynamicTimeZoneInformation(
_Out_ PDYNAMIC_TIME_ZONE_INFORMATION pTimeZoneInformation
);

if it returns a 2,. it's daylight savings time, otherwise it's standard time.

does anyone have a function that handles this ?? or, can you tell me how to call it ??

Re: Daylight or standard time

Posted: Mon Jan 11, 2016 9:20 pm
by Auge_Ohr
bwolfsohn wrote:when displaying the time, i'd like to also display whether it's daylight standard time or daylight savings time.

there's a windows function that will return that, but i have never done wrappers for that...

https://msdn.microsoft.com/en-us/librar ... 2147217396

DWORD WINAPI GetDynamicTimeZoneInformation(
_Out_ PDYNAMIC_TIME_ZONE_INFORMATION pTimeZoneInformation
);

if it returns a 2,. it's daylight savings time, otherwise it's standard time.
it is a Structure, read here https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
bwolfsohn wrote:does anyone have a function that handles this ?? or, can you tell me how to call it ??
as i remember StandardDate/DaylightDate are SYSTEMTIME Structure
(https://msdn.microsoft.com/en-us/librar ... 85%29.aspx)
it does contain Start Day / End Day of Daylightsaving.

if you just need Day, not Time Bias, you can calculate it with this
Daylight.ZIP
(409 Bytes) Downloaded 776 times