.ManagementDateTimeconverter: meaningful output

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 15 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
pudding
Posts: 37
Last visit: Mon Feb 09, 2009 9:26 am

.ManagementDateTimeconverter: meaningful output

Post by pudding »

before:

Code: Select all

PS> (Get-WmiObject Win32_OperatingSystem).InstallDate
20081013184949.000000+480
after]:

Code: Select all

PS> [System.Management.ManagementDateTimeconverter]::ToDateTime((Get-WmiObject Win32_OperatingSystem).InstallDate) 
Monday, October 13, 2008 18:49:49
Cheers.
User avatar
pudding
Posts: 37
Last visit: Mon Feb 09, 2009 9:26 am

.ManagementDateTimeconverter: meaningful output

Post by pudding »

before:

Code: Select all

PS> (Get-WmiObject Win32_OperatingSystem).InstallDate
20081013184949.000000+480
after]:

Code: Select all

PS> [System.Management.ManagementDateTimeconverter]::ToDateTime((Get-WmiObject Win32_OperatingSystem).InstallDate) 
Monday, October 13, 2008 18:49:49
Cheers.
This topic is 15 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked