PowerTip: Find Amount of Time Between Two Dates

Doctor Scripto

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



Discussion is closed.

Feedback usabilla icon