Click to See Complete Forum and Search --> : Add 30 minutes to time? (hh:mm)
DanF
Nov 27th, 1999, 05:33 PM
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?
Dan
AlanTodd
Nov 27th, 1999, 07:58 PM
As 1 day is equal to to value 1, to add 30 minutes I would try adding, 1/48.
Compwiz
Nov 27th, 1999, 09:53 PM
This works (at least on my machine):
Private Sub Command1_Click()
Text1.Text = Time + (1 / 24) / 2
End Sub
------------------
Tom Young, 14 Year Old
tyoung@stny.rr.com
ICQ: 15743470 (http://wwp.icq.com/15743470) Add Me (http://wwp.icq.com/scripts/search.dll?to=15743470) ICQ Me (http://wwp.icq.com/scripts/contact.dll?msgto=15743470)
AIM: TomY10 (http://www.aol.com/aim/aim30.html)
PERL, JavaScript and VB Programmer
Serge
Nov 27th, 1999, 10:21 PM
Why do you want to count the time by yourself if you already have a great VB function called DateAdd.
Usage: DateAdd Iterval, Number, Date/Time
Example:
Dim dtTime As Date
dtTime = Time
MsgBox DateAdd("n", 30, dtTime)
------------------
Serge
Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)
[This message has been edited by Serge (edited 11-28-1999).]
MyDate = DateAdd("n", 30, Now)
MyTime = Format(MyDate, "hh:mm")
look for DateAdd in the help files or the MSDN CD
------------------
Wossname,
Email me: wossnamex@talk21.com :)
dang! beat me to it serge!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.