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;
精彩评论