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 NairRank #92 · 22.8K reputationPosted Mar 20, 2011, 7:23 AM EDT
Response.Write(DateTime.Today.Subtract(DateTime.Parse("01-Mar-2011")).Days);
VulpesRank #55 · 29.2K reputationPosted Mar 20, 2011, 4:56 AM EDT
DateTime dt = DateTime.Parse(string_date);
Mohammad Imran6 reputationPosted Mar 20, 2011, 5:07 AM EDT
VulpesRank #55 · 29.2K reputationPosted Mar 20, 2011, 8:18 AM EDT
Suthish NairRank #92 · 22.8K reputationPosted Mar 21, 2011, 12:14 AM EDT
int i = DateTime.Today.Subtract(DateTime.Parse("01-Mar-2011")).Days;\
String message = (i >= 0 && i < 15) ? "Yes" : "No"
VulpesRank #55 · 29.2K reputationPosted Mar 21, 2011, 1:58 AM EDT
Suthish NairRank #92 · 22.8K reputationPosted Mar 21, 2011, 2:31 AM EDT
Mohammad Imran6 reputationPosted Mar 21, 2011, 4:35 AM EDT
Thank you all.