All Forums >> [Scripting] >> WSH & Client Side VBScript >> Convert WMI dates to standard dates and times? Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
I am somewhat a beginner. I have a script that will return certain aspects of scheduled tasks on a PC. The returned format of the date is in CIM datetime. I should be able to use the SWbemDateTime to change the format to a simple normal format. However, this does not work on Windows 2000 (which is what we have at the office). Here is my code.
The "objJob.StartTime" returns the long string of characters such as "********230000.000000-300". Is there a way to do this for Windows 2000?
The description from MSDN for SWbemDateTime states I need to write my own code...so there has to be some way. Thanks for your help!!!!!
Use the SWbemDateTime object to convert these to regular dates and times.
Windows 2000, Windows NT, and Windows 98/95: SWbemDateTime is not available. To convert WMI dates to FILETIME or VT_DATE format or to parse the date into component year, month, day, hours, and so on, you must write your own code.
Also, the example you posted is simply showing a time and not really a date and time like other WMI classes show. If you want more examples search for UTC which is the format used.