判断日期是否为今天,该怎么解决
判断日期是否为今天
在做一个论坛,统计今日发帖数,准备用统计发帖时间是今天的帖子数的方法。
帖子表名:dnt_posts
字段(发帖时间):postdatetime是datetime类型的,有时分秒的,
变量(今日发贴数):int todayPosts
Linq to SQL类:ForumDataContext dc = new ForumDataContext();
int todayPosts = 后面怎么写啊?
------解决方案--------------------
linq不会用
sql 可以 where datediff(day,getdate(),postdatetime)=0
------解决方案--------------------
------解决方案--------------------
来看看 ~帮你顶下~~
在做一个论坛,统计今日发帖数,准备用统计发帖时间是今天的帖子数的方法。
帖子表名:dnt_posts
字段(发帖时间):postdatetime是datetime类型的,有时分秒的,
变量(今日发贴数):int todayPosts
Linq to SQL类:ForumDataContext dc = new ForumDataContext();
int todayPosts = 后面怎么写啊?
------解决方案--------------------
linq不会用
sql 可以 where datediff(day,getdate(),postdatetime)=0
------解决方案--------------------
------解决方案--------------------
来看看 ~帮你顶下~~