UNKNOWN '************************************** 'Windows API/Global Declarations for :Ca ' lculate InternetTime '************************************** '''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''' '*************************************** ' **************************' '* The function InternetTime() returns t ' he current time *' '* in beats. The code to determine the t ' imezone has been written *' '* by Dror Saddan (drors@ietusa.com).*' '* The code to calculate the internettim ' e has been written by*' '* Swatch. I have ported it to Visual Ba ' sic. *' '**' '* Written by Hiu-Hong Hau (hhhau@dds.nl ' )*' '* Date: June 20th 1999 *' '* Website: http://www.supervisie.nl/qla ' unch *' '* Website: http://www.supervisie.nl/gem ' ini *' '**' '* Take a look at QuickLaunch, a skinnab ' le application launcher, *' '* completely written in Visual Basic.*' ' '*************************************** ' **************************' '''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''' Public Type SYSTEMTIME ' 16 Bytes 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 Public Type TIME_ZONE_INFORMATION Bias As Long StandardName(31) As Integer StandardDate As SYSTEMTIME StandardBias As Long DaylightName(31) As Integer DaylightDate As SYSTEMTIME DaylightBias As Long End Type Public Declare Function GetTimeZoneInformation Lib "kernel32" (lpTimeZoneInformation _ As TIME_ZONE_INFORMATION) As Long '************************************** ' Name: Calculate InternetTime ' Description:The function InternetTime( ' ) calculates the internettime, the new t ' ime standard from Swatch. You only have ' to call the function. ' By: Hiu-Hong Hau ' ' ' Inputs:None ' ' Returns:This function returns a value ' containing the internettime. If you want ' to convert it to a small string, you cou ' ld use the following: Mid(Format(MyTime, ' "000.0000000"), 1, 3) ' 'Assumes:Copy and Paste all of these cod ' e in one single module. ' 'Side Effects:None 'This code is copyrighted and has limite ' d warranties. 'Please see http://www.Planet-Source-Cod ' e.com/xq/ASP/txtCodeId.2131/lngWId.1/qx/ ' vb/scripts/ShowCode.htm 'for details. '************************************** Public Function GetTimeZone(Optional ByRef strTZName As String) As Long Dim objTimeZone As TIME_ZONE_INFORMATION Dim lngResult As Long Dim i As Long lngResult = GetTimeZoneInformation&(objTimeZone) Select Case lngResult Case 0&, 1& 'use standard time GetTimeZone = -(objTimeZone.Bias + objTimeZone.StandardBias) 'into minutes For i = 0 To 31 If objTimeZone.StandardName(i) = 0 Then Exit For strTZName = strTZName & Chr(objTimeZone.StandardName(i)) Next Case 2& 'use daylight savings time GetTimeZone = -(objTimeZone.Bias + objTimeZone.DaylightBias) 'into minutes For i = 0 To 31 If objTimeZone.DaylightName(i) = 0 Then Exit For strTZName = strTZName & Chr(objTimeZone.DaylightName(i)) Next End Select End Function Public Function InternetTime() Dim tmpH Dim tmpS Dim tmpM Dim itime Dim tmpZ Dim testtemp As String tmpH = Hour(Time) tmpM = Minute(Time) tmpS = Second(Time) tmpZ = GetTimeZone itime = ((tmpH * 3600 + ((tmpM - tmpZ + 60) * 60) + tmpS) * 1000 / 86400) If itime > 1000 Then itime = itime - 1000 ElseIf itime < 0 Then itime = itime + 1000 End If InternetTime = itime End Function