Bem amigos.. tenho um codigo que me retorna o fuso horário em que está confifurado o wondows....
O que eu gostaria de saber...
Como eu obtenho a informação dos fusos na API do windows para fazer uma comparação...
ou seja... se no sistema estamos no Fuso do Brasil (Horário oficial do Brasil, eu queria digitar um tempo e ele me retornar a qual fuso pertence este tempo
Eu estou usando este para o fuso do sistema
Option Explicit
Option Compare Text
'''''''''''''''''''''''''''''''''''''''''''''''''''''
' Required Types
'''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Private Type TIME_ZONE_INFORMATION
Bias As Long
StandardName(0 To 31) As Integer
StandardDate As SYSTEMTIME
StandardBias As Long
DaylightName(0 To 31) As Integer
DaylightDate As SYSTEMTIME
DaylightBias As Long
End Type
Public Enum TIME_ZONE
TIME_ZONE_ID_INVALID = 0
TIME_ZONE_STANDARD = 1
TIME_ZONE_DAYLIGHT = 2
End Enum
'''''''''''''''''''''''''''''''''''''''''''''''''''''
' Required Windows API Declares
'''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Declare Function GetTimeZoneInformation Lib "kernel32" _
(lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long
Private Declare Sub GetSystemTime Lib "kernel32" _
(lpSystemTime As SYSTEMTIME)
Function TimezoneGMT1() '(TimeGMT As Variant) As Double
Dim TZI As TIME_ZONE_INFORMATION
Dim DST As TIME_ZONE
Dim StandardName As String
DST = GetTimeZoneInformation(TZI)
StandardName = IntArrayToString(TZI.StandardName)
Debug.Print StandardName
End Function
Function TimezoneGMT1() '(TimeGMT As Variant) As Double
Dim TZI As TIME_ZONE_INFORMATION
Dim DST As TIME_ZONE
Dim StandardName As String
DST = GetTimeZoneInformation(TZI)
StandardName = IntArrayToString(TZI.StandardName)
Debug.Print StandardName
End Function
O que eu gostaria de saber...
Como eu obtenho a informação dos fusos na API do windows para fazer uma comparação...
ou seja... se no sistema estamos no Fuso do Brasil (Horário oficial do Brasil, eu queria digitar um tempo e ele me retornar a qual fuso pertence este tempo
Eu estou usando este para o fuso do sistema
Option Explicit
Option Compare Text
'''''''''''''''''''''''''''''''''''''''''''''''''''''
' Required Types
'''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Private Type TIME_ZONE_INFORMATION
Bias As Long
StandardName(0 To 31) As Integer
StandardDate As SYSTEMTIME
StandardBias As Long
DaylightName(0 To 31) As Integer
DaylightDate As SYSTEMTIME
DaylightBias As Long
End Type
Public Enum TIME_ZONE
TIME_ZONE_ID_INVALID = 0
TIME_ZONE_STANDARD = 1
TIME_ZONE_DAYLIGHT = 2
End Enum
'''''''''''''''''''''''''''''''''''''''''''''''''''''
' Required Windows API Declares
'''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Declare Function GetTimeZoneInformation Lib "kernel32" _
(lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long
Private Declare Sub GetSystemTime Lib "kernel32" _
(lpSystemTime As SYSTEMTIME)
Function TimezoneGMT1() '(TimeGMT As Variant) As Double
Dim TZI As TIME_ZONE_INFORMATION
Dim DST As TIME_ZONE
Dim StandardName As String
DST = GetTimeZoneInformation(TZI)
StandardName = IntArrayToString(TZI.StandardName)
Debug.Print StandardName
End Function
Function TimezoneGMT1() '(TimeGMT As Variant) As Double
Dim TZI As TIME_ZONE_INFORMATION
Dim DST As TIME_ZONE
Dim StandardName As String
DST = GetTimeZoneInformation(TZI)
StandardName = IntArrayToString(TZI.StandardName)
Debug.Print StandardName
End Function