Visual Basic > Code Snippets
Current system time
Current system time Private Declare Sub GetLocalTime Lib "kernel32" (lpsysTime As sysTime) Private Type sysTime 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 Function CurrentTime() As String Dim sysTime As sysTime GetLocalTime sysTime CurrentTime = sysTime.wYear & "/" & sysTime.wMonth & "/" & sysTime.wDay & " " & sysTime.wHour & ":" & sysTime.wMinute & ":" & sysTime.wSecond End Function Private Sub Form_Load() MsgBox (CurrentTime) End Sub
Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows