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
Printable View
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
As 1 day is equal to to value 1, to add 30 minutes I would try adding, 1/48.
This works (at least on my machine):
Private Sub Command1_Click()
Text1.Text = Time + (1 / 24) / 2
End Sub
------------------
Tom Young, 14 Year Old
[email protected]
ICQ: 15743470 Add Me ICQ Me
AIM: TomY10
PERL, JavaScript and VB Programmer
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
[email protected]
[email protected]
ICQ#: 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: [email protected] :)
dang! beat me to it serge!