I'm having two dates FromDate and toDate
converting dates like following and passing as parameters to stored procedure:
both variable are of DateTime FromDate, DateTime toDate variables
initial values coming like {10/1/2013 12:00:00 AM}
I have converted that using below code to {10/1/2013 00:00:00}
sparamFromDate.Value = FromDate.ToString("yyyy-MM-dd HH:mm:ss");
sparamToDate.Value = toDate.ToString("yyyy-MM-dd HH:mm:ss");
which is giving me expected result for FromDate as : 2013-10-11 00:00:00.000
But I need a todate in following format how can i convert this in code?
toDate : 2013-10-11 23:59:59.000
toDate.ToString("yyyy-MM-dd 23:59:59.000");
It doesnt matter if toDate is just the date or has a time component - the output will be the same and what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With