in my database i stored date in the format "yyyy-mm-dd" i need to compare the stored dates with the current date. But How can i get the current date in the above format in asp.net.
A:
You should consider converting that date field in your database schema to a "datetime" data type. That will make it easier to do operations with this value (e.g. equality, greater than, less than, addition, subtraction etc...).
Brian Hinchey
2010-10-06 05:02:40
+1
A:
if (DateTime.Today.ToString("yyyy-MM-dd").Equals(myDateString))
{
//Do my thing here
}
Ben
2010-10-06 05:15:14