开发者

how to save only time in database without date

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜