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. General Programming
  3. Visual Basic
  4. How to get , what of day NO. between 2 date by days?

How to get , what of day NO. between 2 date by days?

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
13 Posts 4 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.
  • A Offline
    A Offline
    Ahmed El Badry
    wrote on last edited by
    #1

    like 15/1/2008 and 30/1/2008 = 15 day Pleaaaaaaaaase

    Ahmed El-Badry

    S 1 Reply Last reply
    0
    • A Ahmed El Badry

      like 15/1/2008 and 30/1/2008 = 15 day Pleaaaaaaaaase

      Ahmed El-Badry

      S Offline
      S Offline
      Smithers Jones
      wrote on last edited by
      #2

      date2.day-date1.day

      Ahmed El-Badry wrote:

      Pleaaaaaaaaase

      disgusting! you aren't 13. -edit- Unbelievable! you asked a similar question before.[^] -edit 2- twice[^]

      "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

      modified on Sunday, May 18, 2008 7:10 PM

      A 2 Replies Last reply
      0
      • S Smithers Jones

        date2.day-date1.day

        Ahmed El-Badry wrote:

        Pleaaaaaaaaase

        disgusting! you aren't 13. -edit- Unbelievable! you asked a similar question before.[^] -edit 2- twice[^]

        "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

        modified on Sunday, May 18, 2008 7:10 PM

        A Offline
        A Offline
        Ahmed El Badry
        wrote on last edited by
        #3

        This is not what I mean I mean Full date like 8/27/2008 - 5/19/2008 = 100 Day thnx :S

        Ahmed El-Badry

        D S 2 Replies Last reply
        0
        • A Ahmed El Badry

          This is not what I mean I mean Full date like 8/27/2008 - 5/19/2008 = 100 Day thnx :S

          Ahmed El-Badry

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          You've already been given the answer. Hell, you were given the exact code you needed to pull this off, twice. If you can't understand what the single line of code was, then you've got to ask a different question explaining that.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          1 Reply Last reply
          0
          • A Ahmed El Badry

            This is not what I mean I mean Full date like 8/27/2008 - 5/19/2008 = 100 Day thnx :S

            Ahmed El-Badry

            S Offline
            S Offline
            Smithers Jones
            wrote on last edited by
            #5

            ...and I gave you the answer but you don't seem to get it. You asked this question before, got the answer before and didn't get it either. So maybe you should forget about it and do something different? But hell, I am in good mood today so once again: dim date1 as date = 8/27/2008 dim date2 as date = 5/19/2008 dim DiffDays as integer DiffDays = date1.day-date2.day

            "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

            V A 4 Replies Last reply
            0
            • S Smithers Jones

              ...and I gave you the answer but you don't seem to get it. You asked this question before, got the answer before and didn't get it either. So maybe you should forget about it and do something different? But hell, I am in good mood today so once again: dim date1 as date = 8/27/2008 dim date2 as date = 5/19/2008 dim DiffDays as integer DiffDays = date1.day-date2.day

              "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

              V Offline
              V Offline
              Vasudevan Deepak Kumar
              wrote on last edited by
              #6

              Smithers-Jones wrote:

              do something different

              He is poor in understanding things. You should help him understand this in more depth and with clarity.

              Vasudevan Deepak Kumar Personal Homepage
              Tech Gossips
              A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

              1 Reply Last reply
              0
              • S Smithers Jones

                ...and I gave you the answer but you don't seem to get it. You asked this question before, got the answer before and didn't get it either. So maybe you should forget about it and do something different? But hell, I am in good mood today so once again: dim date1 as date = 8/27/2008 dim date2 as date = 5/19/2008 dim DiffDays as integer DiffDays = date1.day-date2.day

                "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

                A Offline
                A Offline
                Ahmed El Badry
                wrote on last edited by
                #7

                Msge.Visible = True Dim date1 As Date = "8/27/2008" Dim date2 As Date = "5/19/2008" Dim DiffDays As Integer DiffDays = date1.Day - date2.Day Msge.Text = DiffDays Who got the output of this code is No. 8 days ,This is not true The difference between the dates is 100 days ,This is what i mean Thank you for Help:rose:

                Ahmed El-Badry

                1 Reply Last reply
                0
                • S Smithers Jones

                  ...and I gave you the answer but you don't seem to get it. You asked this question before, got the answer before and didn't get it either. So maybe you should forget about it and do something different? But hell, I am in good mood today so once again: dim date1 as date = 8/27/2008 dim date2 as date = 5/19/2008 dim DiffDays as integer DiffDays = date1.day-date2.day

                  "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

                  A Offline
                  A Offline
                  Ahmed El Badry
                  wrote on last edited by
                  #8

                  Msge.Visible = True Dim date1 As Date = "8/27/2008" Dim date2 As Date = "5/19/2008" Dim DiffDays As Integer DiffDays = date1.Day - date2.Day Msge.Text = DiffDays Who got the output of this code is No. 8 days ,This is not true The difference between the dates is 100 days ,This is what i mean Thank you for Help:rose:

                  Ahmed El-Badry

                  1 Reply Last reply
                  0
                  • S Smithers Jones

                    ...and I gave you the answer but you don't seem to get it. You asked this question before, got the answer before and didn't get it either. So maybe you should forget about it and do something different? But hell, I am in good mood today so once again: dim date1 as date = 8/27/2008 dim date2 as date = 5/19/2008 dim DiffDays as integer DiffDays = date1.day-date2.day

                    "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

                    A Offline
                    A Offline
                    Ahmed El Badry
                    wrote on last edited by
                    #9

                    I used Visual Basic.Net in VS 2003 :sigh:

                    Ahmed El-Badry

                    A S 2 Replies Last reply
                    0
                    • A Ahmed El Badry

                      I used Visual Basic.Net in VS 2003 :sigh:

                      Ahmed El-Badry

                      A Offline
                      A Offline
                      Ahmed El Badry
                      wrote on last edited by
                      #10

                      Msge.Visible = True Dim date1 As Date = "8/27/2008" Dim date2 As Date = "5/19/2008" Dim DiffDays As Integer Dim Diffmonth As Integer Dim Diffyear As Integer DiffDays = date1.Day - date2.Day Diffmonth = date1.Month - date2.Month Diffyear = date1.Year - date2.Year Msge.Text = DiffDays.ToString + " " + Diffmonth.ToString + " " + Diffyear.ToString outing 8 days 3 month 0 year i want convert this to days = 100 days

                      Ahmed El-Badry

                      1 Reply Last reply
                      0
                      • A Ahmed El Badry

                        I used Visual Basic.Net in VS 2003 :sigh:

                        Ahmed El-Badry

                        S Offline
                        S Offline
                        Smithers Jones
                        wrote on last edited by
                        #11

                        Ahmed El-Badry wrote:

                        Msge.Visible = True Dim date1 As Date = "8/27/2008" Dim date2 As Date = "5/19/2008" Dim DiffDays As Integer DiffDays = date1.Day - date2.Day Msge.Text = DiffDays Who got the output of this code is No. 8 days ,This is not true The difference between the dates is 100 days ,This is what i mean

                        Right you are, sorry, my fault. Use this code:

                        Dim date1 As Date
                        Dim date2 As Date
                        date1 = "19.5.2008"
                        date2 = "27.8.2008"
                        Dim Diff As TimeSpan = date2.Subtract(date1)
                        MsgBox(Diff.Days)

                        but still: you asked this question before (more than a year ago). In your CV you write, that you have fair knowlege of VB.NET. This date-stuff is very basic, usually explained in the first chapters of most beginner books.

                        "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

                        A 1 Reply Last reply
                        0
                        • S Smithers Jones

                          date2.day-date1.day

                          Ahmed El-Badry wrote:

                          Pleaaaaaaaaase

                          disgusting! you aren't 13. -edit- Unbelievable! you asked a similar question before.[^] -edit 2- twice[^]

                          "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

                          modified on Sunday, May 18, 2008 7:10 PM

                          A Offline
                          A Offline
                          Ahmed El Badry
                          wrote on last edited by
                          #12

                          Msge.Visible = True Dim date1 As Date = "8/27/2008" Dim date2 As Date = "5/19/2008" Dim DiffDays As Integer Dim Diffmonth As Integer Dim Diffyear As Integer DiffDays = date1.Day - date2.Day Diffmonth = date1.Month - date2.Month Diffyear = date1.Year - date2.Year Msge.Text = DiffDays.ToString + " " + Diffmonth.ToString + " " + Diffyear.ToString outing 8 days 3 month 0 year i want convert this to days = 100 days :confused:

                          Ahmed El-Badry

                          1 Reply Last reply
                          0
                          • S Smithers Jones

                            Ahmed El-Badry wrote:

                            Msge.Visible = True Dim date1 As Date = "8/27/2008" Dim date2 As Date = "5/19/2008" Dim DiffDays As Integer DiffDays = date1.Day - date2.Day Msge.Text = DiffDays Who got the output of this code is No. 8 days ,This is not true The difference between the dates is 100 days ,This is what i mean

                            Right you are, sorry, my fault. Use this code:

                            Dim date1 As Date
                            Dim date2 As Date
                            date1 = "19.5.2008"
                            date2 = "27.8.2008"
                            Dim Diff As TimeSpan = date2.Subtract(date1)
                            MsgBox(Diff.Days)

                            but still: you asked this question before (more than a year ago). In your CV you write, that you have fair knowlege of VB.NET. This date-stuff is very basic, usually explained in the first chapters of most beginner books.

                            "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

                            A Offline
                            A Offline
                            Ahmed El Badry
                            wrote on last edited by
                            #13

                            thnx u :-D :rose:

                            Ahmed El-Badry

                            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