timespan question

  • Thread starter Thread starter mcnewsxp
  • Start date Start date
M

mcnewsxp

it looks like if your time span goes over an hour myspan.Minutes only returns the minutes over the hour. i need all the minutes.
?
tia,
mcnewsxp
 
it looks like if your time span goes over an hour myspan.Minutes only returns the minutes over the hour. i need all the minutes.

?

tia,

mcnewsxp

myspan,TotalMinutes

duh...
 
Or....

TMinuttes = (myspan.Hours * 60) + myspan.Minuttes;

/Finn
"mcnewsxp" skrev i meddelelsen
it looks like if your time span goes over an hour myspan.Minutes only returns the minutes over the hour. i need all the minutes.

?

tia,

mcnewsxp

myspan,TotalMinutes

duh...
 
"mcnewsxp" skrev i meddelelsen


Or....

TMinuttes = (myspan.Hours * 60) + myspan.Minuttes;

That does neither return the same data type or
the same value.

1h1m1s results in 61 and 61.016666666666666 respectively.

Arne
 
That does neither return the same data type or
the same value.

1h1m1s results in 61 and 61.016666666666666 respectively.

One could also argue that it is not good to do calculations
that .NET can do for one.

But the risk of minutes per hour to be changed is not
that big.

:-)

Arne
 
One could also argue that it is not good to do calculations
that .NET can do for one.

But the risk of minutes per hour to be changed is not
that big.

Oh yeah? What about when we all switch to METRIC TIME, huh?
 
"Peter Duniho" skrev i meddelelsen
Or....

TMinuttes = (myspan.Hours * 60) + myspan.Minuttes;

But that only works if TotalHours < 24. It also doesn't take into account
the seconds, if that's important.

The OP really does want TotalMinutes. It's silly to try to compute from
scratch something that the data structure already provides directly.

Point taken. Same goes for Arne's point !!
 
Back
Top