Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. DATE DIFFERENCE

DATE DIFFERENCE

Scheduled Pinned Locked Moved ASP.NET
tutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Parvai
    wrote on last edited by
    #1

    How to find how many years,months,dates in two different dates format dd/mm/yyyy eg 01/06/2001 to 11/06/2006 ouput:5 years,0months,10 days parthiban

    J T 2 Replies Last reply
    0
    • P Parvai

      How to find how many years,months,dates in two different dates format dd/mm/yyyy eg 01/06/2001 to 11/06/2006 ouput:5 years,0months,10 days parthiban

      J Offline
      J Offline
      J4amieC
      wrote on last edited by
      #2

      in C#? DateTime dt1 = new DateTime(2001,6,1); DateTime dt2 = new DateTime(2006,6,11); TimeSpan ts = dt2.Subtract(dt1); The TimeSpan class has propertiessuch as "TotalDays" which will give you the info you want. Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour

      1 Reply Last reply
      0
      • P Parvai

        How to find how many years,months,dates in two different dates format dd/mm/yyyy eg 01/06/2001 to 11/06/2006 ouput:5 years,0months,10 days parthiban

        T Offline
        T Offline
        Tirthadip
        wrote on last edited by
        #3

        hi , you can use SQL also to find the difference between two dates. the code looks like : DATEDIFF(part of the date,start date,end date) "part of the date" means whether its day,month or year of a date variable. Tirthadip Live life to the fullest

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups