开发者

how to save only time in database without date

开发者 https://www.devze.com 2023-04-11 07:41 出处:网络
How to save only time of day in database without saving date? I am trying this statement but its save date and time:

How to save only time of day in database without saving date? I am trying this statement but its save date and time:

    DateTime time= Convert.ToDateTime(开发者_如何学JAVArec.InOutTimes[i].entry.Value.ToShortDateString(),null)


You can store the value as seconds or milliseconds, then use Timespan.

TimeSpan interval = TimeSpan.FromMilliseconds(500);
int millis = interval.TotalMilliseconds;
0

精彩评论

暂无评论...
验证码 换一张
取 消