Results 1 to 6 of 6

Thread: how can i get the date of (two day befor now) in vb6 ?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2014
    Posts
    16

    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

  2. #2
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: how can i get the date of (two day befor now) in vb6 ?

    Look up the DateDiff function.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2014
    Posts
    16

    Re: how can i get the date of (two day befor now) in vb6 ?

    can you explain this function ^_^

  4. #4
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,084

    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

  5. #5
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    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())

  6. #6
    Hyperactive Member
    Join Date
    Jun 2014
    Location
    Lahore, Pakistan
    Posts
    450

    Re: how can i get the date of (two day befor now) in vb6 ?

    Quote Originally Posted by DataMiser View Post
    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
  •  



Click Here to Expand Forum to Full Width