473,327 Members | 1,997 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.

Time functions

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
4 1353
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
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rick | last post by:
Hello all. I have an index.php file that has a lot of functions that I wrote. Let's say for the sake of argument that there are 1000 functions of 100 lines each. The index.php file is invoked...
18
by: bart_nessux | last post by:
I need a script to call several functions at the same time. How does one call more than one function simultaneously?
11
by: Bryant Huang | last post by:
Hello! I would like to read in files, during run-time, which contain plain Python function definitions, and then call those functions by their string name. In other words, I'd like to read in...
3
by: Luis Pedro | last post by:
Hi there, Can anyone tell me if there is any time and date standard functions for C++ and, if so, were can I find documentation about it? If such functions do not exist, any hint of what library...
17
by: newbiecpp | last post by:
I have hard time to understand run-time environment. Let assume that I have a program that has a simple variable alpha. When this variable is statically allocated, the compiler can use the...
5
by: RICHARD BROMBERG | last post by:
I am writing an ASP program that includes a Form. When the Form is submitted I use the Date() and Time() functions to put the date and time into the Body part of the e-mail. The time reported is...
5
by: rs | last post by:
I have a table with a timestamp field which contains the date and time. ie. 9/13/2004 9:10:00 AM. I would like to split this field into 2 fields, one with just the DATE portion ie 9/13/2004 and...
7
by: dc | last post by:
Can anybody think of a situation where virtual function's address resolution/ something related to virtual is done at compile time
0
hqprog
by: hqprog | last post by:
Having search extensively I've learned the two functions timegm and gmtime_r though in the GNU standard C library extend the ISO standard. I need to use these two functions in myprog.c (on pc - ...
0
yasirmturk
by: yasirmturk | last post by:
Standard Date and Time Functions The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.