By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,266 Members | 1,300 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,266 IT Pros & Developers. It's quick & easy.

Time functions

P: n/a
A program takes a number of entries and multiplies that number by 2.5
(representing 2 and a half minutes per entry). This gives me a number that
I want to display the actual minutes and seconds.

Is there a built in function in VB .Net to take that number and convert to
minutes/seconds?

Thanks for the information.

Brad
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Brad,

Yes, multiply it by 150 instead of 2.5 than you can write.

Messagebox.show(TimeSpan.FromSeconds(3 * 150).ToString())

I hope this helps,

Cor
Nov 21 '05 #2

P: n/a
"Brad" <ba******@ukcdogs.com> schrieb:
A program takes a number of entries and multiplies that number by 2.5
(representing 2 and a half minutes per entry). This gives me a number
that I want to display the actual minutes and seconds.

Is there a built in function in VB .Net to take that number and convert to
minutes/seconds?


The number is already in minutes, isn't it? You may want to take a look at
'TimeSpan' and 'DateTime' for date/time calculations and formatting.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

P: n/a
Look at the TimeSpan

for example this gives you how long 100000 seconds is:

Dim ts As New TimeSpan(0, 0, 100000)
MsgBox(ts.ToString)

hth Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"Brad" <ba******@ukcdogs.com> schreef in bericht
news:e1**************@TK2MSFTNGP10.phx.gbl...
A program takes a number of entries and multiplies that number by 2.5
(representing 2 and a half minutes per entry). This gives me a number that I want to display the actual minutes and seconds.

Is there a built in function in VB .Net to take that number and convert to
minutes/seconds?

Thanks for the information.

Brad

Nov 21 '05 #4

P: n/a
Thanks guys for the information. The TimeSpan function works just great.

Brad

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uZ**************@TK2MSFTNGP14.phx.gbl...
Brad,

Yes, multiply it by 150 instead of 2.5 than you can write.

Messagebox.show(TimeSpan.FromSeconds(3 * 150).ToString())

I hope this helps,

Cor

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.