Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Converting WMI Date and Time

$
0
0

It would help to see your starting code. Also, are you just trying to output the dates and times to the screen, or do you want to save the converted values in an object for later use?

Here’s a simple example that just writes to the screen, which might help get you started:

foreach ($object in $someCollection)
{
    $dateTime = [System.Management.ManagementDateTimeConverter]::ToDateTime($object.someWmiDateStringProperty)
    Write-Host $dateTime
}

Viewing all articles
Browse latest Browse all 13067

Trending Articles