Decode Unusual Timespan

  • Thread starter Thread starter Charles Law
  • Start date Start date
C

Charles Law

I have a 'timespan' which is specified in an unusual way. For example, to
specify 47 hours and 26 minutes, the timepsan is specified as

47:26

If I use Timespen.TryParse on this then, of course, it fails. Can anyone
think of a neat way to decode timespans specified in this way? I also have
timespans specified as

3.30

which would mean 3hrs and 30 minutes.

I realise that I could split the values and format my own timespan, but I am
wondering if there is a one-liner built-in.

TIA

Charles
 
Hi Patrice

Thanks for the reply. From that I read that there is no one-liner, so I am
stuck with rolling my own, as you say.

Cheers

Charles
 
Back
Top