Jump to content
Sign in to follow this  
anixon

Registry DWord Date

Recommended Posts

anixon

This reads the date serial number [i'm guessing] that Windows [XP or Vista] was installed

;Windows Install Date

;

$readreg = RegRead("HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION\", "InstallDate")

MsgBox(0,"Installation Date", $readreg)

Exit

It produces the following number "1196279887"

How do you convert that to dd:mm:yy hh:mm:ss format?

Ant..

Edited by anixon

Share this post


Link to post
Share on other sites
enaiman

Hello Anixon :)

Haven't seen you in a while.

Here is the explanation of that number you get:

http://www.ilopia.com/Private/installDate.aspx

Now that you have the explanation - I will leave the challenge to make a time converter to you :)


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites
anixon

Hello Anixon :)

Haven't seen you in a while.

Here is the explanation of that number you get:

http://www.ilopia.com/Private/installDate.aspx

Now that you have the explanation - I will leave the challenge to make a time converter to you :)

Hello enaiman :)

Been working on Skype and Cordless phone related issues..

This is how I solved my issue...

;Windows Install Date

;

$readreg = RegRead("HKLM\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION\", "InstallDate")

$sNewDate = _DateAdd( 's',$readreg, "1970/01/01 00:00:00")

MsgBox( 4096, "", "Date: " & $sNewDate )

Exit

In Excel its a little different:

Excels date serial number 1 is 1900/01/01 where Windows install dates are recorded in seconds starting at 1970/01/01 so if you are using Excel to get the correct date then you have to add the days serial number for 1970/01/01 (25569) to the days serial number for the install date. =Round( InstallDate / (60*60*24),0) + 25569

Thanks for the clue...

Edited by anixon

Share this post


Link to post
Share on other sites
enaiman

You solved it brilliantly :)

I never thought of doing it this way, been thinking to build myself a function to do that :)

Well done my friend.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.