Home > Archive > Visual Studio > February 2005 > Convert minutes to hours and minutes
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Convert minutes to hours and minutes
|
|
| Rudi Groenewald 2005-02-07, 4:04 pm |
| Hi all,
I think I have got the stupiest question but, I've got minutes worked out in
a field using dateDiff..... now how do I convert my minutes to hours and
minutes? Only thing I wanna know is if my DateTimeDiff field has got 408
minutes in it, how do I convert it to hours minutes and seconds? It should
still be kept in dates cause I want to sum all the values to give me a total
hours minutes and seconds.
Thanks
Rudi
| |
| Kevin Spencer 2005-02-07, 4:04 pm |
| Hours = seconds / 60 / 60
Hours = minutes / 60
Minutes = seconds / 60
If you give me minutes, I can give you minutes and hours. If you give me
seconds, I can give you seconds, minutes, and hours. It's simple algebra.
408 Minutes = x Hours plus R Minutes
408 / 60 = 68 plus 0 R(emainder)
408 Minutes = 68 Hours, 0 minutes
410 Minutes = x Hours plus R Minutes
410 / 60 = 68 plus 2 R(emainder)
410 Minutes = 68 Hours, 2 Minutes
6125 Seconds = x Hours plus R Minutes plus r Seconds
6125 / 60 = 102 plus 5 R(emainder)
5 / 60 = 0 plus 5 r(emainder)
6125 Seconds = 102 Hours, 0 Minutes, 5 seconds
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
"Rudi Groenewald" <noone@paflof.com> wrote in message
news:cu7tnt$o1r$1@ctb-nnrp2.saix.net...
> Hi all,
>
> I think I have got the stupiest question but, I've got minutes worked out
> in a field using dateDiff..... now how do I convert my minutes to hours
> and minutes? Only thing I wanna know is if my DateTimeDiff field has got
> 408 minutes in it, how do I convert it to hours minutes and seconds? It
> should still be kept in dates cause I want to sum all the values to give
> me a total hours minutes and seconds.
>
> Thanks
> Rudi
>
|
|
|
|
|