Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GMT in VB

Status
Not open for further replies.

bzac

Programmer
Dec 20, 2000
55
US
I want to convert my localmachine time to GMT in VB6 or acess the Server time from a local machine, any idea ? please.
 
Option Explicit



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 Declare Sub GetSystemTime Lib "kernel32.dll" (lpSystemTime As SYSTEMTIME)



Private Sub Form_Load()
Dim gmt As Date
Dim utctime As SYSTEMTIME
GetSystemTime utctime ' put the time and date in UTC time into utctime
gmt = utctime.wMonth & "/" & utctime.wDay & "/" & utctime.wYear & " " & _
utctime.wHour & ":" & utctime.wMinute & ":" & utctime.wSecond
MsgBox "GMT = " & gmt
End Sub
David Paulson


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top