Hi,
Can someone kindly point me in the direction of flag that indicates if a PC clock is currently showing GMT or summer time?
RichardL
[/list]
GMT/SummerTime flag
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Use GetTimeZoneInformation_(TimeZoneInformation.TIME_ZONE_INFORMATION)
Look at http://www.purebasic.fr/english/viewtop ... hlight=gmt
I think TIME_ZONE_ID_DAYLIGHT is what you are looking for.TIME_ZONE_INFORMATION wrote:The GetTimeZoneInformation function retrieves the current time-zone parameters. These parameters control the translations between Coordinated Universal Time (UTC) and local time.
DWORD GetTimeZoneInformation(
LPTIME_ZONE_INFORMATION lpTimeZoneInformation // address of time-zone settings
);
Parameters
lpTimeZoneInformation
Points to a TIME_ZONE_INFORMATION structure to receive the current time-zone parameters.
Return Values
If the function succeeds, the return value is one of the following values:
Value Meaning
TIME_ZONE_ID_UNKNOWN The operating system cannot determine the current time zone. This is usually because a previous call to the SetTimeZoneInformation function supplied only the bias (and no transition dates).
TIME_ZONE_ID_STANDARD The operating system is operating in the range covered by the StandardDate member of the structure pointed to by the lpTimeZoneInformation parameter.
TIME_ZONE_ID_DAYLIGHT The operating system is operating in the range covered by the DaylightDate member of the structure pointed to by the lpTimeZoneInformation parameter.
Look at http://www.purebasic.fr/english/viewtop ... hlight=gmt
Last edited by gnozal on Mon Mar 13, 2006 4:07 pm, edited 1 time in total.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
@gnozal: Thanks for that, I wrote a little procedure for it:
Code: Select all
Procedure IsSummerTime()
; Fred is aware that these need adding to PureBasic. ;)
#TIME_ZONE_ID_UNKNOWN = 0
#TIME_ZONE_ID_STANDARD = 1
#TIME_ZONE_ID_DAYLIGHT = 2
#TIME_ZONE_ID_INVALID = $FFFFFFFF
Select GetTimeZoneInformation_(tzi.TIME_ZONE_INFORMATION)
Case #TIME_ZONE_ID_UNKNOWN,#TIME_ZONE_ID_INVALID : r=-1
Case #TIME_ZONE_ID_STANDARD : r=0
Case #TIME_ZONE_ID_DAYLIGHT : r=1
EndSelect
ProcedureReturn r
EndProcedure
Debug IsSummerTime() ; 0 = No, 1 = Yes, -1 = Don't know.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
Thank you both. Yes, this pushed me in the right directio.
@gnozal. Your 2003 example appears to use the \DaylightBias value incorrectly. This value is the correction to UTC to be made IF within the daylight saving part of the year. The \Bias value should then be added to this.
All teh best...
RichardL
@gnozal. Your 2003 example appears to use the \DaylightBias value incorrectly. This value is the correction to UTC to be made IF within the daylight saving part of the year. The \Bias value should then be added to this.
All teh best...
RichardL
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Yes, you are right : old post changedRichardL wrote:@gnozal. Your 2003 example appears to use the \DaylightBias value incorrectly.

For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).