Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Convert seconds to minutes and seconds

Reply
Thread Tools

Convert seconds to minutes and seconds

 
 
tshad
Guest
Posts: n/a
 
      03-11-2005
Is there a quick function in vb out there that will convert seconds to
minutes and seconds?

Thanks,

Tom


 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      03-11-2005
How about a couple of operators instead?

seconds \ 60 = minutes
seconds Mod 60 = seconds

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"tshad" <(E-Mail Removed)> wrote in message
news:usT$(E-Mail Removed)...
> Is there a quick function in vb out there that will convert seconds to
> minutes and seconds?
>
> Thanks,
>
> Tom
>



 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      03-11-2005
Or

dim t as new TimeSpan(0,0,135)

t.Minutes
t.Seconds

Karl


--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Kevin Spencer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How about a couple of operators instead?
>
> seconds \ 60 = minutes
> seconds Mod 60 = seconds
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> What You Seek Is What You Get.
>
> "tshad" <(E-Mail Removed)> wrote in message
> news:usT$(E-Mail Removed)...
> > Is there a quick function in vb out there that will convert seconds to
> > minutes and seconds?
> >
> > Thanks,
> >
> > Tom
> >

>
>



 
Reply With Quote
 
tshad
Guest
Posts: n/a
 
      03-11-2005
"Kevin Spencer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How about a couple of operators instead?
>
> seconds \ 60 = minutes
> seconds Mod 60 = seconds


That works fine.

I was just interested to see if there was a function that did it as part of
an object.

Thanks,

Tom
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> What You Seek Is What You Get.
>
> "tshad" <(E-Mail Removed)> wrote in message
> news:usT$(E-Mail Removed)...
>> Is there a quick function in vb out there that will convert seconds to
>> minutes and seconds?
>>
>> Thanks,
>>
>> Tom
>>

>
>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      03-11-2005
Yes. You would have to put the values into a DateTime object and use the
..Minutes and .Seconds properties. But my method is more efficient.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"tshad" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> "Kevin Spencer" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> How about a couple of operators instead?
>>
>> seconds \ 60 = minutes
>> seconds Mod 60 = seconds

>
> That works fine.
>
> I was just interested to see if there was a function that did it as part
> of an object.
>
> Thanks,
>
> Tom
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> What You Seek Is What You Get.
>>
>> "tshad" <(E-Mail Removed)> wrote in message
>> news:usT$(E-Mail Removed)...
>>> Is there a quick function in vb out there that will convert seconds to
>>> minutes and seconds?
>>>
>>> Thanks,
>>>
>>> Tom
>>>

>>
>>

>
>



 
Reply With Quote
 
tshad
Guest
Posts: n/a
 
      03-11-2005
"Kevin Spencer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Yes. You would have to put the values into a DateTime object and use the
> .Minutes and .Seconds properties. But my method is more efficient.


I agree.

Since there isn't much to it (I also put a Cint around the minutes
calculation), there is really no reason to set up a separate object to
handle it.

Thanks,

Tom
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> What You Seek Is What You Get.
>
> "tshad" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> "Kevin Spencer" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> How about a couple of operators instead?
>>>
>>> seconds \ 60 = minutes
>>> seconds Mod 60 = seconds

>>
>> That works fine.
>>
>> I was just interested to see if there was a function that did it as part
>> of an object.
>>
>> Thanks,
>>
>> Tom
>>>
>>> --
>>> HTH,
>>>
>>> Kevin Spencer
>>> Microsoft MVP
>>> .Net Developer
>>> What You Seek Is What You Get.
>>>
>>> "tshad" <(E-Mail Removed)> wrote in message
>>> news:usT$(E-Mail Removed)...
>>>> Is there a quick function in vb out there that will convert seconds to
>>>> minutes and seconds?
>>>>
>>>> Thanks,
>>>>
>>>> Tom
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      03-11-2005
> Since there isn't much to it (I also put a Cint around the minutes
> calculation), there is really no reason to set up a separate object to
> handle it.


No need for a CInt around anything. The VB.Net "\" operator returns an
integer.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"tshad" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Kevin Spencer" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Yes. You would have to put the values into a DateTime object and use the
>> .Minutes and .Seconds properties. But my method is more efficient.

>
> I agree.
>
> Since there isn't much to it (I also put a Cint around the minutes
> calculation), there is really no reason to set up a separate object to
> handle it.
>
> Thanks,
>
> Tom
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> What You Seek Is What You Get.
>>
>> "tshad" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> "Kevin Spencer" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> How about a couple of operators instead?
>>>>
>>>> seconds \ 60 = minutes
>>>> seconds Mod 60 = seconds
>>>
>>> That works fine.
>>>
>>> I was just interested to see if there was a function that did it as part
>>> of an object.
>>>
>>> Thanks,
>>>
>>> Tom
>>>>
>>>> --
>>>> HTH,
>>>>
>>>> Kevin Spencer
>>>> Microsoft MVP
>>>> .Net Developer
>>>> What You Seek Is What You Get.
>>>>
>>>> "tshad" <(E-Mail Removed)> wrote in message
>>>> news:usT$(E-Mail Removed)...
>>>>> Is there a quick function in vb out there that will convert seconds to
>>>>> minutes and seconds?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Tom
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
tshad
Guest
Posts: n/a
 
      03-11-2005
"Kevin Spencer" <(E-Mail Removed)> wrote in message
news:%23%(E-Mail Removed)...
>> Since there isn't much to it (I also put a Cint around the minutes
>> calculation), there is really no reason to set up a separate object to
>> handle it.

>
> No need for a CInt around anything. The VB.Net "\" operator returns an
> integer.


I didn't know about that one.

You're right. It works fine that way. I just automatically used "/".

Thanks,

Tom
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> What You Seek Is What You Get.
>
> "tshad" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> "Kevin Spencer" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Yes. You would have to put the values into a DateTime object and use the
>>> .Minutes and .Seconds properties. But my method is more efficient.

>>
>> I agree.
>>
>> Since there isn't much to it (I also put a Cint around the minutes
>> calculation), there is really no reason to set up a separate object to
>> handle it.
>>
>> Thanks,
>>
>> Tom
>>>
>>> --
>>> HTH,
>>>
>>> Kevin Spencer
>>> Microsoft MVP
>>> .Net Developer
>>> What You Seek Is What You Get.
>>>
>>> "tshad" <(E-Mail Removed)> wrote in message
>>> news:%(E-Mail Removed)...
>>>> "Kevin Spencer" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> How about a couple of operators instead?
>>>>>
>>>>> seconds \ 60 = minutes
>>>>> seconds Mod 60 = seconds
>>>>
>>>> That works fine.
>>>>
>>>> I was just interested to see if there was a function that did it as
>>>> part of an object.
>>>>
>>>> Thanks,
>>>>
>>>> Tom
>>>>>
>>>>> --
>>>>> HTH,
>>>>>
>>>>> Kevin Spencer
>>>>> Microsoft MVP
>>>>> .Net Developer
>>>>> What You Seek Is What You Get.
>>>>>
>>>>> "tshad" <(E-Mail Removed)> wrote in message
>>>>> news:usT$(E-Mail Removed)...
>>>>>> Is there a quick function in vb out there that will convert seconds
>>>>>> to minutes and seconds?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Tom
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to convert MGRS coordinates to latitude and longitude (degrees,minutes, seconds) clusardi2k@aol.com Java 1 08-13-2012 04:46 PM
How to convert Seconds to X Hours Y Minutes Z Seconds? 00_CP_D12 ASP .Net 3 02-22-2008 10:37 AM
convert seconds to hours:minutes:seconds `p Ruby 7 12-14-2005 03:32 PM
1. Ruby result: 101 seconds , 2. Java result:9.8 seconds, 3. Perl result:62 seconds Michael Tan Ruby 32 07-21-2005 03:23 PM
Converting seconds to (Days, Hours, Minutes, seconds) Stu C Programming 7 03-07-2005 08:44 AM



Advertisments