How to get the start and end times of a day

后端 未结 10 731
无人及你
无人及你 2020-12-24 00:29

In my C# app, I pass a string variable that is of format yyyymmdd-yyyymmdd that represents a from and to date. I want to get the start and end times for these dates respecti

10条回答
  •  离开以前
    2020-12-24 01:13

    For SQL Server (version 2008 R2 tested) this ranges works.

    StarDate '2016-01-11 00:00:01.990' EndDate '2016-01-19 23:59:59.990'

    Seems like ticks is greater that the last second of day and automatically round to next day. So i test and works, i made a dummy table with two dates for check what values is sql server catching and inserting in the stored procedure those parameters.

提交回复
热议问题