Support Forums > WinFBX - Windows Framework for FreeBASIC
AfxTime
Richard Kelly:
Using the latest WINFBE version, function AfxTimeZoneBias works as expected and when I use AfxTimeZoneDaylightBias I always get decimal 4294967236 or FFFFFFC4 as the return value.
I see that WORD is defined as uShort and wonder if that could be the source of the issue. -60 is FFC4.
José Roca:
Change
PRIVATE FUNCTION AfxTimeZoneBias () AS DWORD
PRIVATE FUNCTION AfxTimeZoneDaylightBias () AS DWORD
to
PRIVATE FUNCTION AfxTimeZoneBias () AS LONG
PRIVATE FUNCTION AfxTimeZoneDaylightBias () AS LONG
and many thanks for reporting it.
Richard Kelly:
Jose...that cleared things up.
Richard Kelly:
You have:
AfxTimeZoneDaylightDay
AfxTimeZoneDaylightDayOfWeek
AfxTimeZoneDaylightHour
AfxTimeZoneDaylightMonth
For the transition from Standard to Daylight and I could not find:
AfxTimeZoneStandardDay
AfxTimeZoneStandardDayOfWeek
AfxTimeZoneStandardHour
AfxTimeZoneStandardMonth
for the transition from Daylight to Standard. Per MSDN, when the StandardDate.wMonth = 0, daylight savings is not observed.
José Roca:
--- Code: ---' ========================================================================================
' Returns the time zone identifier.
' Return values:
' - TIME_ZONE_ID_UNKNOWN (0)
' Daylight saving time is not used in the current time zone, because there are no
' transition dates or automatic adjustment for daylight saving time is disabled.
' - TIME_ZONE_ID_STANDARD (1)
' The system is operating in the range covered by the StandardDate member of the
' TIME_ZONE_INFORMATION structure.
' - TIME_ZONE_ID_DAYLIGHT (2)
' The system is operating in the range covered by the DaylightDate member of the
' TIME_ZONE_INFORMATION structure.
' If the function fails for other reasons, such as an out of memory error, it returns
' TIME_ZONE_ID_INVALID. To get extended error information, call GetLastError.
' ========================================================================================
PRIVATE FUNCTION AfxTimeZoneId () AS DWORD
DIM tzi AS TIME_ZONE_INFORMATION
RETURN GetTimeZoneInformation(@tzi)
END FUNCTION
' ========================================================================================
' ========================================================================================
' Indicates whether the the system is operating in the range covered by the StandardDate
' member of the TIME_ZONE_INFORMATION structure.
' ========================================================================================
PRIVATE FUNCTION AfxTimeZoneIsStandardSavingTime () AS BOOLEAN
DIM tzi AS TIME_ZONE_INFORMATION
DIM r AS DWORD = GetTimeZoneInformation(@tzi)
RETURN (r = TIME_ZONE_ID_STANDARD)
END FUNCTION
' ========================================================================================
' ========================================================================================
PRIVATE FUNCTION AfxTimeZoneStandardDay () AS WORD
DIM tzi AS TIME_ZONE_INFORMATION
DIM r AS DWORD = GetTimeZoneInformation(@tzi)
IF r = TIME_ZONE_ID_INVALID THEN RETURN 0
RETURN tzi.StandardDate.wDay
END FUNCTION
' ========================================================================================
' ========================================================================================
PRIVATE FUNCTION AfxTimeZoneStandardDayOfWeek () AS WORD
DIM tzi AS TIME_ZONE_INFORMATION
DIM r AS DWORD = GetTimeZoneInformation(@tzi)
IF r = TIME_ZONE_ID_INVALID THEN RETURN 0
RETURN tzi.StandardDate.wDayOfWeek
END FUNCTION
' ========================================================================================
' ========================================================================================
PRIVATE FUNCTION AfxTimeZoneStandardHour () AS WORD
DIM tzi AS TIME_ZONE_INFORMATION
DIM r AS DWORD = GetTimeZoneInformation(@tzi)
IF r = TIME_ZONE_ID_INVALID THEN RETURN 0
RETURN tzi.StandardDate.wHour
END FUNCTION
' ========================================================================================
' ========================================================================================
PRIVATE FUNCTION AfxTimeZoneStandardMonth () AS WORD
DIM tzi AS TIME_ZONE_INFORMATION
DIM r AS DWORD = GetTimeZoneInformation(@tzi)
IF r = TIME_ZONE_ID_INVALID THEN RETURN 0
RETURN tzi.StandardDate.wMonth
END FUNCTION
' ========================================================================================
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version