January 17th, 2016

PowerTip: Find Amount of Time Between Two Dates

Doctor Scripto
Scripter

Summary: Learn how to use Windows PowerShell to find the amount of time between two dates.

Hey, Scripting Guy! Question How can I use Windows PowerShell to determin how many days until
            Windows PowerShell Saturday on March 19, 2016 in Tampa?

Hey, Scripting Guy! Answer There are many ways to find the difference between two dates. I use the [datetime] type accelerator
           and subtraction, for example:

[datetime]'3/19/16' – [datetime]::now

 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback