NT Date Format

NT Date Format

Question:
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:

01BD2AB6829D4000

Answer:
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 LongEnd TypePrivate 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 IntegerEnd TypePrivate 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, _                                  ptypSystemTime)      Debug.Print ptypSystemTime.wMonth & "/" & _               ptypSystemTime.wDay & "/" & _               ptypSystemTime.wYear & "   " & _               ptypSystemTime.wHour & ":" & _               ptypSystemTime.wMinute & ":" & _               ptypSystemTime.wSecond & ":" & _               ptypSystemTime.wMillisecondsEnd Sub

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of