smaguire
asked on
DateTime Compare Function
hi,
I have the following function that returns always 1 no matter what:
for (i = 0; i <= Count - 2; i++) {
for (j = 0; j <= 6; j++) {
strWeekDay = DateTime.Today.AddDays(Dat eTime.Comp are(DateTi me.Today.A ddDays(j), StartTime)).ToString("dddd ");
...etc
}
}
When I run it (Today) it always return Saturday!. I tried the compare function on its own and namtter what I enter for the StartTime (DateTime Variable) it always returns 1
I am trying to get the difference between the two sates in Days of the Week (Sunday, Monday...)
any idea how to fix it?
I am using ASP.NET - C#
I have the following function that returns always 1 no matter what:
for (i = 0; i <= Count - 2; i++) {
for (j = 0; j <= 6; j++) {
strWeekDay = DateTime.Today.AddDays(Dat
...etc
}
}
When I run it (Today) it always return Saturday!. I tried the compare function on its own and namtter what I enter for the StartTime (DateTime Variable) it always returns 1
I am trying to get the difference between the two sates in Days of the Week (Sunday, Monday...)
any idea how to fix it?
I am using ASP.NET - C#
Can't you use DateTime.Compare() ?
ASKER
thats what I am using
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks