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. difference between dates

difference between dates

Scheduled Pinned Locked Moved ASP.NET
question
7 Posts 2 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.
  • M Offline
    M Offline
    Mathew P V
    wrote on last edited by
    #1

    how can i find the difference between two calendar dates to calculate number of days and display it in a label.

    C 1 Reply Last reply
    0
    • M Mathew P V

      how can i find the difference between two calendar dates to calculate number of days and display it in a label.

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      TimeSpan difference = myFirstDate - mySecondDate;

      Man who stand on hill with mouth open wait long time for roast duck to drop in

      M 1 Reply Last reply
      0
      • C Colin Angus Mackay

        TimeSpan difference = myFirstDate - mySecondDate;

        Man who stand on hill with mouth open wait long time for roast duck to drop in

        M Offline
        M Offline
        Mathew P V
        wrote on last edited by
        #3

        thank you for replying its showing an error "Error 3 Cannot implicitly convert type 'System.TimeSpan' to 'string'" what should i do.

        C 1 Reply Last reply
        0
        • M Mathew P V

          thank you for replying its showing an error "Error 3 Cannot implicitly convert type 'System.TimeSpan' to 'string'" what should i do.

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          Mathew P V wrote:

          its showing an error "Error 3 Cannot implicitly convert type 'System.TimeSpan' to 'string'"

          Eh?! You might like to read the MSDN documentation on TimeSpan to find out how it works and how to get data out of it. No where in my advice would you have got the error above. Just blindly converting things to strings is often unwise.

          Man who stand on hill with mouth open wait long time for roast duck to drop in

          M 1 Reply Last reply
          0
          • C Colin Angus Mackay

            Mathew P V wrote:

            its showing an error "Error 3 Cannot implicitly convert type 'System.TimeSpan' to 'string'"

            Eh?! You might like to read the MSDN documentation on TimeSpan to find out how it works and how to get data out of it. No where in my advice would you have got the error above. Just blindly converting things to strings is often unwise.

            Man who stand on hill with mouth open wait long time for roast duck to drop in

            M Offline
            M Offline
            Mathew P V
            wrote on last edited by
            #5

            thank you for the valuable reply, i am new to asp.net. please give me some suggestions so that i can improve.

            C 1 Reply Last reply
            0
            • M Mathew P V

              thank you for the valuable reply, i am new to asp.net. please give me some suggestions so that i can improve.

              C Offline
              C Offline
              Colin Angus Mackay
              wrote on last edited by
              #6

              Mathew P V wrote:

              i am new to asp.net. please give me some suggestions so that i can improve.

              If you are asking for help then show code so we can see what you are doing. Asking us to guess based on vague or incomplete descriptions does not (as Dr. Cox [Scrubs] would put it) "help me to help you".

              Man who stand on hill with mouth open wait long time for roast duck to drop in

              M 1 Reply Last reply
              0
              • C Colin Angus Mackay

                Mathew P V wrote:

                i am new to asp.net. please give me some suggestions so that i can improve.

                If you are asking for help then show code so we can see what you are doing. Asking us to guess based on vague or incomplete descriptions does not (as Dr. Cox [Scrubs] would put it) "help me to help you".

                Man who stand on hill with mouth open wait long time for roast duck to drop in

                M Offline
                M Offline
                Mathew P V
                wrote on last edited by
                #7

                i used

                timespan diff=calendar1.selecteddate.substract(calendar2.selecteddate);

                and now its working thank you for your valuable suggestion i will do the same.

                modified on Tuesday, June 2, 2009 6:06 AM

                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