Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: NT
Expertise: Beginner
Dec 4, 1998



Application Security Testing: An Integral Part of DevOps

NT Date Format

I am trying to develop a VB program to interface with a database from a third-party imaging product. The database is SQL Server and the product stores dates as 8-byte binary values (it does not use the SQL Server date format). I've spoken with their technical support and they tell me that the dates are in the "standard" NT system date format; however, I cannot find anything on Microsoft's Web site that documents this format. Examples of what I am looking at are as follows:


I suspect that what the info is stored in is a FILETIME structure. If so, the following should work for you. The number you gave translated to 1/27/1998.

Private Type FILETIME
   dwLowDateTime                 As Long
   dwHighDateTime                As Long
End Type

   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 Function FileTimeToSystemTime _
   Lib "kernel32" _
   (lpFileTime As FILETIME, _
    lpSystemTime As SYSTEMTIME) As Long
Private Sub Command1_Click()
   Dim plngRtn             As Long
   Dim ptypSystemTime      As SYSTEMTIME
   Dim ptypFileTime        As FILETIME
   ptypFileTime.dwLowDateTime = &H829D4000
   ptypFileTime.dwHighDateTime = &H1BD2AB6
   plngRtn = FileTimeToSystemTime(ptypFileTime, _
   Debug.Print ptypSystemTime.wMonth & "/" & _
               ptypSystemTime.wDay & "/" & _
               ptypSystemTime.wYear & "   " & _
               ptypSystemTime.wHour & ":" & _
               ptypSystemTime.wMinute & ":" & _
               ptypSystemTime.wSecond & ":" & _
End Sub
DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date