I want to run a report in which I want to pass parameters as the start time, which is yesterday at 12 a.m. (midnight) and enddate, as it is today 12 a.m. (in the middle of the night), how to get midnight in datetime format in C #
Current date without any time (at midnight)
DateTime.Today
Yesterday at midnight
DateTime.Today.AddDays(-1)
The object that is installed to date, with the time component set to 00:00:00.
Console.Write(DateTime.Today);
Output:
11/11/2012 12:00:00 AM
. . , ,
DateTime.Today for date date
, ? yyyy-MM-dd HH:mm:ss, , :
yyyy-MM-dd HH:mm:ss
2012-05-12 00:00:00 2012-05-13 00:00:00
2012-05-12 00:00:00
2012-05-13 00:00:00
.
From Date: DateTime.Today.AddDays(-1) To Date: DateTime.Today