-
Jul 5th, 2014, 11:38 AM
#1
Thread Starter
Junior Member
how can i get the date of (two day befor now) in vb6 ?
I want the date of two day before when I click the commend ??
if the date now is 5/7/2014 when I click I want 3/7/2014
-
Jul 5th, 2014, 12:20 PM
#2
Re: how can i get the date of (two day befor now) in vb6 ?
Look up the DateDiff function.
-
Jul 5th, 2014, 12:40 PM
#3
Thread Starter
Junior Member
Re: how can i get the date of (two day befor now) in vb6 ?
can you explain this function ^_^
-
Jul 5th, 2014, 02:01 PM
#4
Re: how can i get the date of (two day befor now) in vb6 ?
Code:
Private Sub Command1_Click()
Print Now, Now - 2
End Sub
note that Now includes the time of day
-
Jul 5th, 2014, 02:02 PM
#5
Re: how can i get the date of (two day befor now) in vb6 ?
Actually for this you would want the DateAdd() function, specify day and -2
Code:
NewDate=DateAdd("d",-2,Now())
-
Jul 6th, 2014, 12:51 AM
#6
Hyperactive Member
Re: how can i get the date of (two day befor now) in vb6 ?
Originally Posted by DataMiser
Actually for this you would want the DateAdd() function, specify day and -2
Code:
NewDate=DateAdd("d",-2,Now())
I'm with this, best option*
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
|