Larry Bowen wrote in message
<1EA35E87BFDCD2119E820008C7F9E55DB4F7FE@CPECMAILE01>...
i have the same Problem. It looks like the Time format is based on the
1970.01.01 0:00 counting the Seconds to now. So you (and me too) need a
Function to convert this fTime Structur of the Date to the VB Time&Date
Format.
Maybe the Function SystemTimeToVariantTime form the oleaut32.dll may help. I
will try this out ....
Bye
Axel Braukmann
Larry Bowen <La...@BowenAero.com> schrieb in im Newsbeitrag:
1EA35E87BFDCD2119E820008C7F9E55DB4F7FE@CPECMAILE01...
Will
Debug.Print DateAdd("s", nNumSeconds, #1/1/70#)
Work for you?
--
Scott Seligman <sc...@scottandmichelle.net>
http://www.scottandmichelle.net/scott/code/
Sample code, message forum, and utilities..
thanks very much.
Scott Seligman wrote in message <#iWNCS8w#GA.306@cppssbbsa04>...
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Get NT Install Date '
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
lRetLen = 50
lRetVal = RegOpenKeyEx(lRemReg_HLM _
, "SOFTWARE\Microsoft\Windows NT\CurrentVersion" _
, 0, KEY_READ, lKeyHandle_HLM)
If lRetVal <> SUCCESS Then
'MsgBox "Can't Open Key. Error: " & lRetVal, vbCritical,
"Error!"
lblInstallDate.Caption = BlankVal
Else
lRetValQ = RegQueryValueEx(lKeyHandle_HLM _
, "InstallDate" _
, 0&, REG_DWORD, lRegVal, lRetLen)
If lRetValQ = SUCCESS Then
lRegVal = RegTimeToVbTime(lRegVal)
lblInstallDate.Caption = Format(lRegVal, "short date")
lblInstallDate.ToolTipText = Format(lRegVal, "long
date")
End If
lRetVal = RegCloseKey(lKeyHandle_HCU)
End If
Public Function RegTimeToVbTime(RegDate As Long) As Double
Const BaseDate# = 25569 'DateSerial(1970, 1, 1)
Const SecsPerDay# = 86400
RegTimeToVbTime = BaseDate + (CDbl(RegDate) / SecsPerDay)
End Function
==========================================================
In article <#GnsCD4w#GA....@cppssbbsa02.microsoft.com>,
"Axel Braukmann" <Axel_Br...@Hotmail.com> wrote:
> Hello Larry,
>
> i have the same Problem. It looks like the Time format is based on the
> 1970.01.01 0:00 counting the Seconds to now. So you (and me too) need
a
> Function to convert this fTime Structur of the Date to the VB
Time&Date
> Format.
>
> Maybe the Function SystemTimeToVariantTime form the oleaut32.dll may
help. I
> will try this out ....
>
> Bye
> Axel Braukmann
>
> Larry Bowen <La...@BowenAero.com> schrieb in im Newsbeitrag:
> 1EA35E87BFDCD2119E820008C7F9E55DB4F7FE@CPECMAILE01...
> > I'm trying to display the NT install date in my app. I can get it
from
> > HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> > NT\CurrentVersion\InstallDate with RegQueryValueEx, but can't make
sense
> > of the REG_DWORD value. How do I convert the "36bf6044" to
something
> > like 12/12/1998? Thx!
> >
>
>
--
-Larry
http://BowenAero.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.