SELECT COUNT(l.LogSeq), date_format(l.CreateDate,'%Y-%m') CreateDateByMonth FROM LOL l WHERE l.CreateDate>='2017-1-1' AND l.CreateDate<='2017-8-16' GROUP BY CreateDateByMonth 把数据按照月份分组获取所需要的数据SQL语句变为EF,错误的写法: //先做基本查询 var querySql = from l in LOL se…
本文收录在个人博客:www.chengxy-nds.top,技术资料共享,同进步 时间格式化在项目中使用频率是非常高的,当我们的 API 接口返回结果,需要对其中某一个 date 字段属性进行特殊的格式化处理,通常会用到 SimpleDateFormat 工具处理. SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date stationTime = dateFormat.parse(dateForma…