I have this code

Dim replace As String = System.DateTime.Now.AddDays(7).ToString("yyyy-MM-dd")

What I'm trying to do is

Dim replace As String = textbox1.text.AddDays(7).ToString("yyyy-MM-dd")

is there a way to use that add days from a text or string value already?

Are you wanting to do the following?

Dim thisDate As Date = #3/27/2010#
    Dim thisString As String = "3/27/2010"


    'Add 7 Days

    MsgBox(thisDate.AddDays(7).ToShortDateString)
    MsgBox(CDate(thisString).AddDays(7).ToShortDateString)
    
        Dim newString As String = thisDate.AddDays(7).ToShortDateString
    Label1.Text = newString

Edited 4 Years Ago by Phasma: n/a

Are you wanting to do the following?

Dim thisDate As Date = #3/27/2010#
    Dim thisString As String = "3/27/2010"


    'Add 7 Days

    MsgBox(thisDate.AddDays(7).ToShortDateString)
    MsgBox(CDate(thisString).AddDays(7).ToShortDateString)
    
        Dim newString As String = thisDate.AddDays(7).ToShortDateString
    Label1.Text = newString

hmmm...something like that but, first I get the Label's date from my server (LAN CONNECTION) then the value through that date on the label is what I want to use the ADDDAYS

It doesn't matter how you get it as a string or a date type you just need to convert it to and from the type you want to use it as.

I think this will help you

Dim replace As String = CDate(textbox1.text).AddDays(7).ToString("yyyy-MM-dd")

I think this will help you

Dim replace As String = CDate(textbox1.text).AddDays(7).ToString("yyyy-MM-dd")

THANKS! that's what exactly I need

This question has already been answered. Start a new discussion instead.