Hello,
I want to find the difference between two dates. one is current date and second one is date which is stored in sql database.
like i have to compare a string from current date and if string_date is less than 15 days from current date then i have to send a message yes or no.
Please help me its urgent.
Loading
Suthish NairPosted Mar 20, 2011, 11:23 AM
Response.Write(DateTime.Today.Subtract(DateTime.Parse("01-Mar-2011")).Days);
Mohammad ImranPosted Mar 21, 2011, 8:35 AM
Thank you all.
Suthish NairPosted Mar 21, 2011, 6:31 AM
VulpesPosted Mar 21, 2011, 5:58 AM
Suthish NairPosted Mar 21, 2011, 4:14 AM
int i = DateTime.Today.Subtract(DateTime.Parse("01-Mar-2011")).Days;\
String message = (i >= 0 && i < 15) ? "Yes" : "No"
VulpesPosted Mar 20, 2011, 12:18 PM
Mohammad ImranPosted Mar 20, 2011, 9:07 AM
VulpesPosted Mar 20, 2011, 8:56 AM
DateTime dt = DateTime.Parse(string_date);