473,327 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Convert seconds to minutes and seconds

Is there a quick function in vb out there that will convert seconds to
minutes and seconds?

Thanks,

Tom
Nov 19 '05 #1
7 2683
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" <ts**********@ftsolutions.com> wrote in message
news:us**************@tk2msftngp13.phx.gbl...
Is there a quick function in vb out there that will convert seconds to
minutes and seconds?

Thanks,

Tom

Nov 19 '05 #2
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" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:eb**************@TK2MSFTNGP15.phx.gbl...
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" <ts**********@ftsolutions.com> wrote in message
news:us**************@tk2msftngp13.phx.gbl...
Is there a quick function in vb out there that will convert seconds to
minutes and seconds?

Thanks,

Tom


Nov 19 '05 #3
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:eb**************@TK2MSFTNGP15.phx.gbl...
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" <ts**********@ftsolutions.com> wrote in message
news:us**************@tk2msftngp13.phx.gbl...
Is there a quick function in vb out there that will convert seconds to
minutes and seconds?

Thanks,

Tom


Nov 19 '05 #4
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" <ts**********@ftsolutions.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:eb**************@TK2MSFTNGP15.phx.gbl...
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" <ts**********@ftsolutions.com> wrote in message
news:us**************@tk2msftngp13.phx.gbl...
Is there a quick function in vb out there that will convert seconds to
minutes and seconds?

Thanks,

Tom



Nov 19 '05 #5
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uA**************@TK2MSFTNGP15.phx.gbl...
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" <ts**********@ftsolutions.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:eb**************@TK2MSFTNGP15.phx.gbl...
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" <ts**********@ftsolutions.com> wrote in message
news:us**************@tk2msftngp13.phx.gbl...
Is there a quick function in vb out there that will convert seconds to
minutes and seconds?

Thanks,

Tom



Nov 19 '05 #6
> 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" <ts**********@ftsolutions.com> wrote in message
news:ur**************@tk2msftngp13.phx.gbl... "Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uA**************@TK2MSFTNGP15.phx.gbl...
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" <ts**********@ftsolutions.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:eb**************@TK2MSFTNGP15.phx.gbl...
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" <ts**********@ftsolutions.com> wrote in message
news:us**************@tk2msftngp13.phx.gbl...
> Is there a quick function in vb out there that will convert seconds to
> minutes and seconds?
>
> Thanks,
>
> Tom
>



Nov 19 '05 #7
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2*****************@TK2MSFTNGP09.phx.gbl...
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" <ts**********@ftsolutions.com> wrote in message
news:ur**************@tk2msftngp13.phx.gbl...
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uA**************@TK2MSFTNGP15.phx.gbl...
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" <ts**********@ftsolutions.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:eb**************@TK2MSFTNGP15.phx.gbl...
> 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" <ts**********@ftsolutions.com> wrote in message
> news:us**************@tk2msftngp13.phx.gbl...
>> Is there a quick function in vb out there that will convert seconds
>> to minutes and seconds?
>>
>> Thanks,
>>
>> Tom
>>
>
>



Nov 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rudi Groenewald | last post by:
Hi all. If I've got a query which has a field with seconds in it... how will I use the Convert function to get my field converted to the format: HH:MM:SS ? The field with the seconds in is...
3
by: fred14214 | last post by:
I need to be able to enter an elapsed time into a text field. This time then needs to be converted into seconds and stored in a field in some table. The user will enter a time (format is...
2
by: Chris | last post by:
Hi, Can someone convert this to VB.NET Please. I am trying but for some reason it doesn't work. if (null != Request.QueryString) { secondsToWait = Request.QueryString; if...
2
by: 00_CP_D12 | last post by:
Is there an easy way in ASP.NET to convert seconds to Hours: Minutes: Seconds? For example, 65 seconds will return 0 hr, 1 min, 5 secs. Thanks...
29
by: Jan | last post by:
Hi: I have an Access database that's been running (in one form or another) for a couple of different clients for a few years. Now a new client has requested that it be implemented with a SQL...
9
by: bakxchaixDD | last post by:
I DON'T GET THIS project: Many treadmills output the speed in miles per hour. However, most runners think of their pace in minutes and seconds per mile. Write a program that inputs a decimal...
7
by: jimmy1 | last post by:
Hello everyone I am trying to find a way to convert seconds to minutes in the script below - Private Sub cmdBegin_Click() On Error Resume Next n = Val(txttime.Text) * 60 tmrClock.Enabled = True...
5
by: =?Utf-8?B?U2hlbGRvbg==?= | last post by:
Hello - I have about ten integer values that each need to be converted to days, hours, minutes and seconds. I can't seem to find a formula for same that works. These integer values come from a...
3
by: =?Utf-8?B?U2hlbGRvbg==?= | last post by:
Hello - I have various times formatted like 00:00:00, so for example, 01:32:05 would be one thirty-two with five milliseconds. I need to convert this into seconds (an integer). First of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.