CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Date question

  1. #1
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    140

    Date question

    I have a date in the format dd/mm/yyyy
    e.g
    a=10/01/2000
    How to I get "a - 3 days" in the same format (07/01/00)??
    Thanks


  2. #2
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: Date question

    What 'a 3-days' means?
    What do you exactly do you want to do?
    Do you use text boxes, or date pickers?

    Michael Vlastos
    Automation Engineer
    Company SouthGate Hellas SA
    Development Department
    Athens, Greece

  3. #3
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Date question

    How about (as an example) :


    '
    Dim sTempDate as string
    Dim dDate as date
    '
    sTempDate = "10/01/2000"
    '
    dDate = CDate(Format(sTempDate, "DD/MM/YYYY"))
    '
    dDate = dDate - 3
    '
    sTempDate = Format$(dDate, "DD/MM/YYYY")
    '
    MsgBox sTempDate
    '





    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

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

Featured