anixon Posted May 28, 2008 Posted May 28, 2008 (edited) 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 May 28, 2008 by anixon
enaiman Posted May 28, 2008 Posted May 28, 2008 Hello Anixon Haven't seen you in a while.Here is the explanation of that number you get:http://www.ilopia.com/Private/installDate.aspxNow 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 :)
anixon Posted May 28, 2008 Author Posted May 28, 2008 (edited) Hello Anixon Haven't seen you in a while.Here is the explanation of that number you get:http://www.ilopia.com/Private/installDate.aspxNow 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 )ExitIn 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) + 25569Thanks for the clue... Edited May 28, 2008 by anixon
enaiman Posted May 28, 2008 Posted May 28, 2008 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 :)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now