How to get , what of day NO. between 2 date by days?
-
This is not what I mean I mean Full date like 8/27/2008 - 5/19/2008 = 100 Day thnx :S
Ahmed El-Badry
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 -
This is not what I mean I mean Full date like 8/27/2008 - 5/19/2008 = 100 Day thnx :S
Ahmed El-Badry
...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)
-
...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)
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 -
...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)
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
-
...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)
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
-
...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)
I used Visual Basic.Net in VS 2003 :sigh:
Ahmed El-Badry
-
I used Visual Basic.Net in VS 2003 :sigh:
Ahmed El-Badry
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
-
I used Visual Basic.Net in VS 2003 :sigh:
Ahmed El-Badry
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)
-
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
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
-
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)
thnx u :-D :rose:
Ahmed El-Badry