VB6 Format(Now) for milliseconds

7 04 2010
Option Explicit     
   
Private 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  
   
Private Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)  

Usage:

Dim NowTime As SYSTEMTIME  
Dim sYear, sMonth, sDayOfWeek, sDay, sHour, sMinute, sSecond, sMilliseconds As String   

GetSystemTime NowTime  

sYear         = Format(NowTime.wYear, "0000")  
sMonth        = Format(NowTime.wMonth, "00")  
sDay          = Format(NowTime.wDay, "00")  
sHour         = Format(NowTime.wHour, "00")  'wHour - or + X depends local timezone
sMinute       = Format(NowTime.wMinute, "00")  
sSecond       = Format(NowTime.wSecond, "00")  
sMilliseconds =  Format(NowTime.wMilliseconds, "000")   
Advertisements

Actions

Information

One response

8 09 2018
hacktools

I discovered your blog site web site on yahoo and take a look at just a few of your early contents. Proceed to maintain the very good run http://www.small-games.pro . I merely extra up your RSS feed to us RSS Bar News Reader. Searching for forward to checking out very from you later on!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s




%d bloggers like this: