|
-
Nov 27th, 1999, 06:33 PM
#1
Thread Starter
New Member
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
-
Nov 27th, 1999, 08:58 PM
#2
Junior Member
As 1 day is equal to to value 1, to add 30 minutes I would try adding, 1/48.
-
Nov 27th, 1999, 10:53 PM
#3
Hyperactive Member
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
-
Nov 27th, 1999, 11:21 PM
#4
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).]
-
Nov 27th, 1999, 11:22 PM
#5
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] 
-
Nov 27th, 1999, 11:23 PM
#6
dang! beat me to it serge!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|