You must Sign In to post a response.
  • Category: ASP.NET

    date difference using

    i have 2 values in 2 textbox, so i want to find the difference days b/w this

    pls hepl me
  • #278986
    You can use datetime object of datetime class.which will allow you to do it.
    also you can do it through date object of javascript.
    I do not have snippet but I prefer you to create ur own logic using this guidance. :)

    Ketan raval
    Software developer

  • #278995
    Dim dt As DateTime = Convert.ToDateTime(TextBox1.Text)
    Dim dt1 As DateTime = Convert.ToDateTime(TextBox2.Text)
    Dim ts As TimeSpan = dt1.Subtract(dt)


  • #278996

    In with Vb as code behind we can use with DateDiff() function. below is the sample for doing it.

    Dim lngdiff As Long = DateDiff(DateInterval.Hour, CDate(TextBox2.Text), CDate(TextBox3.Text))


    Thanks & Regards
    D.Jeya Kumar(JK)

  • #279020

    You can use timespan

    thanks and regards,

  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.