InstallDate 
Author Message
 InstallDate

Hello,

I need to write a VBS to extract and convert the InstallDate value from:

 HKLM\Software\Microsoft\WindowsNT\CurrentVersion

This Date is in HEX like (3ec0479d).  The Decimal value would be
(1052788637) this is the number of seconds since 12:00am January 1, 1970.

I know how to retrieve the value but converting it is the problem I'm
having.  Please Help!!!

Thanks

Juan Carlos Mu?oz



Mon, 28 Nov 2005 07:20:14 GMT  
 InstallDate
sHexNum = "3ec0479d"
WScript.Echo Eval("&H" & sHexNum)

Best regards
Johnny Nielsen



Quote:
> Hello,

> I need to write a VBS to extract and convert the InstallDate value from:

>  HKLM\Software\Microsoft\WindowsNT\CurrentVersion

> This Date is in HEX like (3ec0479d).  The Decimal value would be
> (1052788637) this is the number of seconds since 12:00am January 1, 1970.

> I know how to retrieve the value but converting it is the problem I'm
> having.  Please Help!!!

> Thanks

> Juan Carlos Mu?oz



Mon, 28 Nov 2005 07:53:15 GMT  
 InstallDate
Oh, and if you want it converted to a date:

sHexNum = "3ec0479d"
WScript.Echo DateAdd("s", Eval("&H" & sHexNum), "1-Jan-70 12:00am")

Best regards
Johnny Nielsen


Quote:
> sHexNum = "3ec0479d"
> WScript.Echo Eval("&H" & sHexNum)

> Best regards
> Johnny Nielsen



> > Hello,

> > I need to write a VBS to extract and convert the InstallDate value from:

> >  HKLM\Software\Microsoft\WindowsNT\CurrentVersion

> > This Date is in HEX like (3ec0479d).  The Decimal value would be
> > (1052788637) this is the number of seconds since 12:00am January 1,
1970.

> > I know how to retrieve the value but converting it is the problem I'm
> > having.  Please Help!!!

> > Thanks

> > Juan Carlos Mu?oz



Mon, 28 Nov 2005 08:03:16 GMT  
 InstallDate

Hi,

Thanks for the reply.  Now that I am able to convert the number to
decimal, how is it converted to a Date.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Mon, 28 Nov 2005 08:18:36 GMT  
 InstallDate



Quote:
>I need to write a VBS to extract and convert the InstallDate value from:

> HKLM\Software\Microsoft\WindowsNT\CurrentVersion

>This Date is in HEX like (3ec0479d).  The Decimal value would be
>(1052788637) this is the number of seconds since 12:00am January 1, 1970.

It will probably be the number of seconds, ignoring leap seconds, since
1970-01-01 00:00:00 GMT - note the GMT.

--

 Web  <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
 PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
 Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.



Tue, 29 Nov 2005 01:35:52 GMT  
 InstallDate
Look at my second answer ;-)

Best regards
Johnny Nielsen


Quote:

> Hi,

> Thanks for the reply.  Now that I am able to convert the number to
> decimal, how is it converted to a Date.

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Tue, 29 Nov 2005 02:26:50 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. InstallDate via RegQueryValueEx

 

 
Powered by phpBB® Forum Software