Visual Basic .NET » Windows Registry and File I/O
Hexadecimal Integer -- JonTurlington --


I have a question about a number I am getting from the registry that is supposed to represent a date but I can't figure it out.

I can get the number no problem, but converting it to the useable date just baffles me.

It is supposed to be a Hexadecimal Number representing a Date.

The integer is for example:(Actually the Registry just calls it a Decimal)

1153234335

The date I should be able to pull from that is:

7/18/2006 09:52:15

Any help would be greatly appreciated.

-- Cerebrus --


Appears to be a Long datatype(VB.NET) rather than Hex. But I dunno about converting it to Datetime...

-- JonTurlington --


Turns out it was a value of seconds since Jan. 1 1970. So I did this

Dim d As Date
d = #1/1/1970#.AddSeconds(NumberSeconds)
ReturnValue = d.ToLocalTime.ToString

Worked like a champ. Thanks though Cerebrus.

-- Cerebrus --


Great ! I've learned something as well. Thanks.

[Submit Comment]Home