Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Adding Minutes To Time


I am sure that is I have just temporarily lack od inteligence....

Here is what I would like to do.
On my form I have textbox with time in it (like 19:12:25).
I would like to add minutes (like 30, 122, 94...) to that time and get the result in format 15:14:12 like I have in textbox.

How to do that?
I tryed with Time1 + Time2 and I had no luck....

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Adding 30 Minutes To Time Value
Easy question.

I want to add 30 minutes to the timedate() value within a label. How do I do that?

Chris, Baltimore.

Adding Minutes To A Time
How can I add for example 7 mintutes to the current time, and have it go back to the top of the hour when it's over 60 minutes, and if it's 11:55:00 PM it'll give 12:02:00 AM. The seconds and time of day are crucial.

Is there a module or already some set code that will do this so I don't have to do this the long way I'm doing right now (cuting and slicing a current time).

Adding Minutes To Time
hi all,

how can i add minutes(suppose 10 minutes) to current system time


Adding Minutes To A Supplied Time
I need to compare to times. However, the second time needs to be greater than the first time by at least 9 minutes.

This is what i had first:

So I need it to be something like this:
>TimeValue([txtTFrom].[Value]) + 10

But, as you can guess, that didn't work.

Anyone know how to add an additional 10 minutes to a given time?

Adding Hours/minutes/secs To Current Time?
hi everyone,

i hope someone out there will be able to help me...

is there a preset function that will add, like, 5 minutes (or 5 hours or 12 secs) to the current time?

i've looked everywhere and found nothing.

thanks in advance.

Adding Minutes
i have got a command button which increases the text number by 10, but because i am using it as part of a clock how do i stop the numbers going past 60.


Formatting And Adding Hours And Minutes In Excel

I have a set of values programatically going into excel,

0.1 and so on...,

the format I want it to go in as is, hours and minutes,
so 0.6 is 0 hours and six minutes,

I also want it to look this way in excel, so I have given the cell
types [h]:mm,

also because some values can be greater than 24 hours I want to roll over 24 hour formatting so I have given the cells time formatting of 37:30:55

however when it goes into excel it looks like this,


I also want to be able to autoSum the cells but the autoSum will not work correctly for the values, any ideas would be appreciated,

thanks JP.

Add Minutes To A Time
Hi, all

anyone know how to add minutes to time? I want to add 15 minutes to 08:00 AM.

VB Code:
Dim Time as DateTime = #08:00# Time = Time + (myminuteshere)'This would produce 08:15 AM for example  

Thanks in advance

Add 30 Minutes To Time? (hh:mm)
I can add day's to months using cvdate, but it does not seem to work with time formatted hh:mm. I wish to add 30 minutes to time stored in a variable. How can i do thsi please?


Add 30 Minutes To Time? (hh:mm)
I can add day's to months using cvdate, but it does not seem to work with time formatted hh:mm. I wish to add 30 minutes to time stored in a variable. How can i do thsi please?


Looking For Someone With 15 Minutes Time
Because I have no experience with VBA I ask you kind people. I have to make this program:
You ask the user for the number of throws
Then you throw a dice (1 to 6) that kind of number and show what the results are in one messagebox. For example:
give number of throws: 5
and then you show:
4 6 2 1 4
This is possible in less then 15 minutes and I can't do this. Is there someone who can do this for me. I will be grateful for it. Gr

Elapsed Time In Minutes
I have an application where my users give me a time and I need to get the elapsed minutes from 7:00 am. Is their a function or easy way to do this ?

TIA for any help!

How Can I Add Minutes To A Time In Javascript
Hi guys,

sorry to post this here but I am very very very in a rush!!

is there a dateAdd() function in javascript like in VB,

tx for your time!!

How To Calculate Minutes Into Time
If I have a var that has 243 in it, how would I calcualte that to minutes.

I would want it to read 0:04:03.


Edited by - Adobe on 5/10/2005 1:13:31 PM

Just Few Minutes Of Your Valuble Time Please...
I had used the OpenText method of workbook to open a text file, delimited with "|". The command runs like this

XlApp.WorkBooks.OpenText FName, xlMsDos, 1, Delimited, xlTextQualifierDoubleQuote, False, False, False, False, False,True, Chr(124), Array(Array(1,9),Array(2,1)...)

The problem is that the Last Parameter that is the FieldInfo is not a constant. With each file it will differ.

Please help me to put a string in the Array Place.


Trying To Understand The Time In Hours. Minutes.....
I have this code:

VB Code:
Private Sub Form_Load()    Timer1.Interval = 100   'fire timer    Timer1.Enabled = True    Timer1.Interval = 60000 '1 minuteEnd Sub Private Sub Timer1_Timer()Static iCounter As Integer     If iCounter = 60 Then        'do something        iCounter = 0    End If    iCounter = iCounter + 1 End Sub

60 supposed to me 1 hour, but for some reason its not, it 60 milliseconds, for the iCounter to be one hour it I should enter 240000.

whats the right timing formate using hour, minutes, second and when using the hour to be 60 min instead of using seconds or milliseconds.


Rounding Time Unit To 15 Minutes
I am currently writing a program that records the number of hours worked on projects to the nearest 15 minutes.

The most common error that users are making is inputting
2hrs 15mins as 2:15 rather than the required 2:25

Has anyone got a routine that would round the minutes worked?

Round Time To The Nearest 15 Minutes?
Does anyone have a lil function / know how to round time to the nearest 15 minutes?

I have broken the day up into 15 minute intervals, and I would like to be able to default to the current interval.

08:40 = 08:30
06:16 = 06:15

Does this make sense?

Thanks alot for your help.

How Can I Calculate The Hours:minutes Between To Time Values
Hi all,

I need to calculate the time difference between a start time and an endtime in this format hours:minutes eg. 1:05.

My time values are in this format hh:mm:ss AM/PM.

Thanks in advance.

Finding Differences In Time - Calculating Minutes
I have tried several ways to do this but to this point am unsucessful. If anyone knows how to accomplish the following please let me know

This has to do with time schedules
I have this data

Start Lunch End
8:00am 11:30am 5:00pm

What I need the code to do is give me the minutes they were scheduled to work and if lunch exists then subtract 60 minutes.

Thanks for any help

Hour(Time) Function; Similar One For Seconds/Minutes?
Are there functions in VB6 that return the minutes and/or seconds of a time variable like the Hour() function that takes a time as its parameter and returns the hour?

Brain Pain... Round Up Time To Nearest 5 Minutes ?
Anyone help out a poor chap withbrain pain ? I simply cannot think of the algorythm to round up the current time to the next five minutes..

humble apologies for such a crass post but all help gratefully received !!!


Is There A Way I Can Time A DesignMode Session, To Revert Back To NORM, In 5 Minutes?
Is there away that I can execute a timer when I switch to the design mode and have the timer set for 5 minutes to revert back to the regular Mode? I'm going to have the macro attached to a tool bar button. I've written such a code before, but can't find it. I remember how to do most all of that, including switching back to normal mode, but I NEED THE CODE, to switch to Design Mode.. My way of getting back to norm, is not real pretty, to think about, but it works just fine. - As I said, I just need to know how to get in, with code. - It is fine with me, to switch to the design Mode, with the DesignMode tool bar button, if you know of a way to have a timed return to normal, that is triggered by that action. I know how to run a timer as a seperate action, that will revert me back, but the problem with that is, I might forget to trigger that proceedure, as I won't be forced to.

The resaon that I need this, is so when I make a quick code modification to a users workstation, I won't have the possibility of getting caught in a DOWN MODE, cued by me forgeting to switch back to the normal mode. - instructing my user's on how to, is not full proof, as a few tend to forget how, and end up loosing considerable time with their tasks. (stuck in a mode(ha, ha) of being too embarrassed to ask for help.

Thanks from: TboltFrank, for any and all Knowledge and/or ideas(-:

Time - Time = ?minutes
How can I get minutes from a time to another time?

Convert Hours And Minutes To Only Minutes?
I have a time in excelcell ex. 08:36. How can I convert it to only minutes?

Convert Minutes To Hour And Minutes??
I want to convert minutes to hours and minutes (alot of minutes) anyone??

Adding And Subtracting Time From Time..
I find this hard to explain but I will do my best. I have a flexgrid, that is supposed to display times in it. For example Row 1 will have 6:00 Row 2 will have 6:10. I have tried using a for next loop to change the time as it goes down the rows. However, I can't figure out how to add say 10 minutes to 6:00 and display that in the next row. I have the following, incorrect code.

num1 = 6:00 'syntax error obviously
For i = 0 To 14
gridtimes.TextMatrix(i, 0) = num1
num1 = num1 + 0:10 ' as well syntax here

Adding Time
Can you add for instance seconds or minutes to the current time?

Example: I want to display the time 12 seconds from the current time.


Adding A Second To Time
Is there a way for adding a second to a variable Time, besides than making a function like:
second = second + 1
if second = 60 then
second = 00
minute = minute + 1
etc ......

Adding Time

I am having a column Hours worked field (format h:m ie 10:30) in a Grid daywise. I want to sum the total hours & minutes (sum of that column).
It is not coming proper. Sample file has been attached. I need the total as mentioned in XL file
Anyone can help?

Adding Time?
Greetings. I'm trying to create a calculator that will add hours and minutes that a user inputs in order to convert them into a time format. I already created the form, it looks like a regular calculator, but I want it to add in terms of hours and minutes. For example, if I enter 8.25 (8 hours and 25 minutes) + 4.50 (4 hours and 50 minutes), I want it to return 13.15, not 12:75. Can someone help please? Thanks.

Adding Time
i was just trying something out concerning adding hours to the actual time.

now, if i did label1.caption = Time + 0.25 it would add 6 hours to the time and show the correct time plus 6 hours.

but if i did it say 5 hours before midnight it would make the time

01:00:00 but for some reason it puts 31/12/1899 01:00:00 in the caption.

it only happens when it goes past midnight.
i can get round it with label1.caption = right(time + 0.25, 8) but why does it do this.


Adding Time
I have a textbox with a time as Now function, how can I make sure if someone wants to alter the time (as it could be a start tiem) that it is entered as hh:mm:ss and allows nothing else?
Also, if I have another text box that has an amount of time in seconds (e.g. 7200), how can I add the start time to this amount and show the new time? e.g. Start time = 15:30:10, 7200 secs pass, finish time = 17:30:10?

Adding Of Time
I would like to find out if it is at all possible through a sql query to add the total time of a field. to get to a total of hundred hours and thirtyfive minutes(100:35 or 100H35)

if there is no such query would it be possible to add the time through code???

Adding Time

I have a loop that gets information from a database. One piece of information is time. How could I add all the time together in 1 value??

Example of the Values from the database:

And i want it up output to one variable:
Total = 00:09:10


Adding Time
hey all i've got the following code to show the time in a label

VB Code:
timee = Format(Time, "hh:mm")Me.Label1.Caption = timee

how could i have it when you click on a button it adds say 3 mins to the current time displayed in the label ?

Adding Time
Hi all i need help adding time, my program currently clocks the current time everytime a button is clicked. But I need to add 10 mins to this time before storing in a database, sort of like time = time + 00:10 if u get what i mean. How do i go about adding that?

Adding Time
I want to add some number iwth time
for example
if time is 2:05:00 PM i want to add 5 hrs 10 mins to that
how can i do that
pls any body help me

Adding Time
i was just trying something out concerning adding hours to the actual time.

now, if i did label1.caption = Time + 0.25 it would add 6 hours to the time and show the correct time plus 6 hours.

but if i did it say 5 hours before midnight it would make the time

01:00:00 but for some reason it puts 31/12/1899 01:00:00 in the caption.

it only happens when it goes past midnight.
i can get round it with label1.caption = right(time + 0.25, 8) but why does it do this.


Adding Time
Is there an easy way to add 15 min to a time value entered in by the user?

Adding Time
hey im trying to add to time values to gether, "hh:mm:ss" format. i cant get anything to work. has any one got a cluie what to do


Adding Time
Hey there!!!

I want to have a command in a data environment that tells the user how long he has been logged on .. I keep a record in microsoft access of when the user logs on and off. is there a function that would allow me to do this in the data environement.. something like the count function that would do this quick??


Just Adding Time
How can I get the text from a textbox added to the system time to display in another textbox?

Thanks in Advance,

Adding To Net Time
ok I'm new to VB... so go easy

I have a wee prog that grabs the time from an NTP server via winsock.

This info is passed to a textbox.

I'm looking to keep the time in this box ticking over.

It would be stupid to keep querying the NTP every second so I need some way of counting this time up...

I've set up a timer with an interval of 1000, but I'm having problems getting the code to work..

Can anyone show me what to do plz?..

Many thanks....

Adding Time
is there a function to add time?

because i have this:

A is a Time in the 24hour, Hour:Minute format (not the current time)
B is the lenght Lenght (in the 24hour Hour:Minute format)
C is Date (not the current date)


now i need to get the time of A+C ?
I can't seperate the hour and minute of both, and then add them together because then the minutes are sometimes over 60

any help is appreciated,



Adding Time
I have a start time & End time variables. I'm trying add the times together to get the total time it took for a project.

It's really not a big deal on how the text has to be laid out in the text box. Right now I have it like this

830 for 8:30

For PM I'm adding 12 hours to the time so I don't end up with negative numbers.

I'm not having any luck with any of this. Can somebody plase help me out on this?

Ken Devorak

Time Adding
Hello all,

I'm developing an App which works with time intervals, now I need to let
the user Input a certain amount of minutes of when he wants the app to do a
certain procedure, and now I'm stucl because I don't know how to add minutes
to the actual time, I could do it with a timer and add the minutes but, I'm
trying to learn how to add minutes to the machine's TIME, any help would be
apreciated thanxs.

Juan C. Oliva jr.

Adding Time
I have a timer to extract some data but once that has finished i need to extract some more data 2hrs after that one has finished. Rather than setting another timer with data input i want to be able to add 2 hrs onto the existing time that the user has said to run the first script. I have tried the following but keep getting rubbish back...

qk = Format$(Text1, "hh:mm")
qk2 = "02:00:00"
qk3 = Format$(qk2, "hh:mm")
qk4 = qk + qk3
Text5 = qk4

Can anyone help?

Adding Time
How do you add time? I am trying to do this in Access QBE Grid. The SQL Statement is as follows:

Code:SELECT DepartTime, ArrivalTime, DepartTime - ArrivalTime as WORKED From Table1

Now I want another column to Total All of the Time Worked.

How is that done?

Copyright 2005-08, All rights reserved