TimeValue

 

Definition: Returns a Variantof subtype Datecontaining the time.

 

OK, so you have a string value (say, 1:45 AM) and you’d like to convert that to a date-time value, is that right? No problem; Windows PowerShell can do that for you. In this command we not only assign the string 1:45 AMto the variable $a, but we also explicitly give $ a a datetimedata type:

 

$a = [ datetime] "1:45 AM"

 

When you run this command (assuming it was run on 9/21/2006) and then echo back the value of $ a youshould get the following:

 

Thursday, September 21, 2006 1:45:00 AM