C# 比较泛型列表中的日期时间

C# 比较泛型列表中的日期时间,c#,generic-list,C#,Generic List,我正在尝试使用下面的代码查询一个通用列表 ArticleStartDate = Convert.ToDateTime("2013-05-07 09:00:00.450"); var queryable = context.GetQueryable<FeaturedArticleResultItem>() queryable = queryable.Where(t => t.StartDisplay > ArticleStartDate).Order

我正在尝试使用下面的代码查询一个通用列表

    ArticleStartDate = Convert.ToDateTime("2013-05-07 09:00:00.450");
    var queryable = context.GetQueryable<FeaturedArticleResultItem>()
    queryable = queryable.Where(t => t.StartDisplay > ArticleStartDate).OrderBy(t => t.StartDisplay);
ArticleStartDate=Convert.ToDateTime(“2013-05-07 09:00:00.450”);
var queryable=context.GetQueryable()
queryable=queryable.Where(t=>t.StartDisplay>article startdate).OrderBy(t=>t.StartDisplay);
我希望得到的结果的“StartDisplay”日期时间晚于5月7日上午9:00,我的查询返回的项目列表晚于当天(第7天,这很好),但是,我也得到了列表中的项目,比如5月7日上午8:30。看起来它比较的是日期,但不是时间

希望以上内容有意义


再多了解一点,我发现t.StartDisplay看起来像这样{7/05/2013 1:31:00 a.m.}。比较时间有关系吗

我会仔细检查以下几点:1)在进入查询之前,是否正确解析了
articlesttartdate
(检查日期和时间,你可能会得到7月5日,或者时间可能没有解析,或者其他一些奇怪的事情);2)你确定你看到的错误结果是7日8:30,而不是8:30(或者您可能看错了月份或年份)是的,我很确定Datetime Article StartDate解析正确,现在是2013年5月7日。不确定出了什么问题……您的服务器和客户端是否在同一时区上运行?您能在服务器上放置一个探查器来检查传递给它的日期时间吗?