Convert.ToDateTime()时间后面怎么加上23:59:59.000
最近做一个查询,需要精确到时分秒,但是我去前台选定的时间:
DateTime jssj = Convert.ToDateTime(this.jssj.Value);
获取的结束时间是:2019-03-31 00:00:00.000
怎么把 2019-03-31 00:00:00.000 后面的 00:00:00.000 改成23:59:59.000
源代码如下:
DateTime kssj = Convert.ToDateTime(this.kssj.Value);
DateTime jssj = Convert.ToDateTime(this.jssj.Value);
DateTime kssjjy = kssj.AddDays(-1);
DateTime jssjjy = jssj.AddDays(1);