Export (0) Print
Expand All
Expand Minimize
0 out of 2 rated this helpful - Rate this topic

Converting VBScript's Second Function


Windows PowerShell


Definition: Returns a whole number between 0 and 59, inclusive, representing the second of the minute.

Second

Is it useful for you to be able to take a specified date and time and throw out everything but the seconds? In other words, if today is 12:29:16 on 9/30/2006, is it useful for you to be able to determine that the seconds are equal to 16?

To tell you the truth, we don’t know whether that’s useful or not. If it is useful, however, you can do that in Windows PowerShell by using the Get-Date Cmdlet and then examining the value of the Second property:


$a = (get-date).second

When you run this command (assuming it really is 12:29:16 on 9/30/2006) and then echo back the value of $a you should get the following:


16


Return to the VBScript to Windows PowerShell home page

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.