timespan question

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
 
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

myspan,TotalMinutes

duh...
 
F

Finn Stampe Mikkelsen

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...
 
A

Arne Vajhøj

"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
 
A

Arne Vajhøj

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
 
J

Jeff Johnson

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?
 
A

Arne Vajhøj

Oh yeah? What about when we all switch to METRIC TIME, huh?

I would be willing to take the chance that decimal time got
implemented in my time ...

:)

Arne
 
F

Finn Stampe Mikkelsen

"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 !!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top