Time functions

  • Thread starter Thread starter Brad
  • Start date Start date
B

Brad

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
 
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
 
Brad said:
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.
 
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
 
Thanks guys for the information. The TimeSpan function works just great.

Brad
 

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

Back
Top