![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | GetDurationFormat/StrFromTimeInterval equivalent Hi, Before writing out my own (buggy) function, I would like to know if there is a .NET built-in function to display a formatted/localized time duration? ex.: - 338 h 45 m 12 s - 1 min 14 sec - 3 days 4 hours Thanks! |
My System Specs![]() |
| | #2 (permalink) |
| Ultimate x64 | Re: GetDurationFormat/StrFromTimeInterval equivalent Try using System.TimeSpan like this: TimeSpan tm; DateTime date1 =newDateTime(2009, 4, 30, 6, 32, 34); DateTime date2 =newDateTime(2009, 5, 5, 3, 4, 38); tm = date2 - date1; Console.WriteLine("Day:{0} - Hour:{1} - Minute: {2} - Second:{3}", tm.Days, tm.Hours, tm.Minutes, tm.Seconds); |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| VB6 Equivalent | .NET General | |||
| how to get pid, equivalent to $$ in unix | PowerShell | |||
| Is there an equivalent to /dev/null | PowerShell | |||
| Equivalent to $0? | PowerShell | |||
| what is the equivalent of xp pro | Vista General | |||