PowerTip: Use PowerShell to Subtract Timespans
Summary: Subtract timespans by using Windows PowerShell.
How can I use Windows PowerShell to subtract 2 days and 14 hours from 12 days and 1 hour to determine the amount of time left on a project?
Create two timespans using the New-Timespan cmdlet, and then subtract them from each other:
(New-TimeSpan -Days 12 -Hours 1) – (New-TimeSpan -Days 2 -Hours 14)