I am to fill a ddl at run time.
What I actually need to do is pick up the current time from the system (in 24-hour format).
Then I need to round it up to a 15 min slot, so if the time is 13:23
it will become 13:30
; if it is 13:12
then it should become 13:15
.
Then I want to add 45 minutes to it, and 13:15 becomes 14:00.
I am trying to achieve it like this
DateTime d = DateTime.Now;
string hr = d.ToString("HH:mm");
string mi = d.ToString("mm");
Could somebody tell, either I have to write all logic or DateTime can provide some feature to format it like this?