I'm having a bad day, struggling with basic PowerShell functionality, help :(

I'm trying to use the following command to return the difference between two 
times

New-TimeSpan -Start $StartDate -End $EndDate

Which works fine, but it returns a bunch of stuff like

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 25
Milliseconds      : 464
Ticks             : 254647496
TotalDays         : 0.000294730898148148
TotalHours        : 0.00707354155555556
TotalMinutes      : 0.424412493333333
TotalSeconds      : 25.4647496
TotalMilliseconds : 25464.7496

I just want to get it to return something like

0 Hours, 0 Minutes, 25 seconds

...but I'm having a total mental block and I appear to have lost the ability to 
do simple manipulation of PowerShell output, all I am managing after quite some 
time is a single line from

(New-TimeSpan -Start $StartDate -End $EndDate).TotalSeconds

Which just gives me "25"

can someone put me out of my misery?

Cheers,



James Rankin
EUC Director | HTG TaloSys | 07809 668579 | 
[email protected]<mailto:[email protected]>
One Trinity Green, Eldon Street, South Shields, Tyne & Wear, NE33 1SA
Tel: 0191 481 3489
Email address: [email protected]<mailto:[email protected]>
Website: www.talosys.co.uk<http://www.talosys.co.uk>
[phpy9YoGNAM]


Reply via email to