注意若数据库时间格式精确位数到毫秒,且搜索的LastTime格式为'yyyy-MM-dd HH:mm:ss',则无法搜索到部分数据。需要将搜索用的LastTime数据+1秒,并不更改实际数据。
将搜索用的LastTime数据+1
historyDto.LastTime = Convert.ToDateTime(historyDto.LastTime).AddSeconds(1).ToString();
注意若数据库时间格式精确位数到毫秒,且搜索的LastTime格式为'yyyy-MM-dd HH:mm:ss',则无法搜索到部分数据。需要将搜索用的LastTime数据+1秒,并不更改实际数据。
将搜索用的LastTime数据+1
historyDto.LastTime = Convert.ToDateTime(historyDto.LastTime).AddSeconds(1).ToString();