I saved the duration in minutes and want to have the output "1 day 5 hours 30 minutes". I am currently adding minutes to Timespan and doing something like this:
TimeSpan ts = new TimeSpan(0,0,1800, 0);
Response.Write(ts.Days + "day(s) " + ts.Hours + " hour(s)" + ts.Minutes + " minutes");
But now I'm only interested in the working hours of the day. Therefore, when the duration of the TimeSpan is 27 hours, it should not create a “1 day 3 hours” output. I want to have "3 days 3 hours."
Is there an easy way to do this using a Timespan object? Is it possible to change the default behavior in TimeSpan? Or do I need to program my own custom Timespan-Class?
thanks cpt.oneeye
source
share