GMT Conversion 
Author Message
 GMT Conversion

Hello all,

I need a routine that will work in Windows 95 and Windows NT that will
convert a time from GMT to EST, i'm using a API call that works well
under Win NT however it will not work correctly in Windows 95

Thanks



Sun, 30 Apr 2000 03:00:00 GMT  
 GMT Conversion

The code following assumes that you are working in the correct Time Zone.

'******** Code Start ******************
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

Type TIME_ZONE_INFORMATION
  Bias As Long
  StandardName(32) As Integer
  StandardDate As SYSTEMTIME
  StandardBias As Long
  DaylightName(32) As Integer
  DaylightDate As SYSTEMTIME
  DaylightBias As Long
End Type

Declare Function GetTimeZoneInformation Lib "kernel32" _
  (lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long

'This function calculates UTC/GMT for the time passed
'The function uses the computer settings to determine Time Zone Information
Function UTC(LocalTime As Date) As Variant
  Dim lngRet As Long
  Dim TZI As TIME_ZONE_INFORMATION
  lngRet = GetTimeZoneInformation(TZI)
  UTC = DateAdd("n", TZI.Bias, LocalTime)
End Function

'This function calculates local time for the GMT passed
'The function uses the computer settings to determine Time Zone Information
Function LocalTime (GMT As Date) As Variant
  Dim lngRet As Long
  Dim TZI As TIME_ZONE_INFORMATION
  lngRet = GetTimeZoneInformation(TZI)
  LocalTime = DateAdd("n", TZI.Bias * -1, GMT)
End Function
'******** Code Start ******************

Quote:

>Hello all,

>I need a routine that will work in Windows 95 and Windows NT that will
>convert a time from GMT to EST, i'm using a API call that works well
>under Win NT however it will not work correctly in Windows 95

>Thanks



Mon, 01 May 2000 03:00:00 GMT  
 GMT Conversion

Quote:

> The code following assumes that you are working in the correct Time Zone.

> '******** Code Start ******************
> 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

> Type TIME_ZONE_INFORMATION
>   Bias As Long
>   StandardName(32) As Integer
>   StandardDate As SYSTEMTIME
>   StandardBias As Long
>   DaylightName(32) As Integer
>   DaylightDate As SYSTEMTIME
>   DaylightBias As Long
> End Type

> Declare Function GetTimeZoneInformation Lib "kernel32" _
>   (lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long

> 'This function calculates UTC/GMT for the time passed
> 'The function uses the computer settings to determine Time Zone Information
> Function UTC(LocalTime As Date) As Variant
>   Dim lngRet As Long
>   Dim TZI As TIME_ZONE_INFORMATION
>   lngRet = GetTimeZoneInformation(TZI)
>   UTC = DateAdd("n", TZI.Bias, LocalTime)
> End Function

> 'This function calculates local time for the GMT passed
> 'The function uses the computer settings to determine Time Zone Information
> Function LocalTime (GMT As Date) As Variant
>   Dim lngRet As Long
>   Dim TZI As TIME_ZONE_INFORMATION
>   lngRet = GetTimeZoneInformation(TZI)
>   LocalTime = DateAdd("n", TZI.Bias * -1, GMT)
> End Function
> '******** Code Start ******************


> >Hello all,

> >I need a routine that will work in Windows 95 and Windows NT that will
> >convert a time from GMT to EST, i'm using a API call that works well
> >under Win NT however it will not work correctly in Windows 95

> >Thanks

Thanks Terry it works great!


Mon, 01 May 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. GMT conversion

2. Newbie Question: GMT Conversion

3. GMT conversion

4. GMT Conversion

5. GMT Conversion

6. GMT to BST conversion

7. UTC GMT Local Conversion?

8. GMT to BST conversion

9. Time conversion to GMT

10. GMT Time conversion...

11. GMT to ET and ET to GMT

12. Help with time conversion between standard time and GMT.

 

 
Powered by phpBB® Forum Software