Results 1 to 3 of 3

Thread: Date Help. Adding to current date.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Colorado
    Posts
    83

    Date Help. Adding to current date.

    What I want to do is take the current date - Date.Now
    and add 1 to it for everyday untill 30 days have passed.

    Also it shouldnt be affected if I where to change the date
    on my computer.

    This should be easy but I have a magical way of complicating things.

    I have this so far, but its be no means functional in anyway.

    VB Code:
    1. Dim dtInstalled As Date = Date.Now
    2.  
    3.         Dim dtInstalledStored As Date = dtInstalled
    4.         TextBox1.Text = dtInstalledStored
    5.  
    6.         Dim dtInstalledExpire = dtInstalledStored.Add() ' ?????
    12/32/84 - I need some code to make me a sandwhich.

  2. #2
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    Is it something like this you mean?

    Code:
    Dim d As Date = Date.Now
    MsgBox(d.AddDays(30).ToString)

  3. #3
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    or even more concise....

    Code:
    textbox.Text = Date.Now.AddDays(30).ToShortDateString

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