新增 动态消息转历史数据 定时器功能

This commit is contained in:
fanghongchao
2018-12-14 18:17:40 +08:00
parent 6ff3926429
commit 3070e8c551
9 changed files with 644 additions and 2 deletions
@@ -38,4 +38,33 @@ public class DateTimeUtil {
throw new RuntimeException("日期转换失败:"+e.getMessage());
}
}
/**
* 字符串转日期
* @param strDate 字符串的日期
* @param pattern 日期格式
* @param locale
* @return
* @throws ParseException
*/
public static Date toDate(String strDate,String pattern,Locale locale)
{
try {
SimpleDateFormat sdf = new SimpleDateFormat(pattern,locale);
return sdf.parse(strDate);
}
catch (ParseException e)
{
throw new RuntimeException("日期转换失败:"+e.getMessage());
}
}
/**
* 获取今天最小时间 单位秒
* @return
*/
public static Long getTodayStartTime(){
String time = DateTimeUtil.gtFormatStr(new Date(), "yyyy-MM-dd",Locale.ENGLISH)+" 00:00:00";
return DateTimeUtil.toDate(time,"yyyy-MM-dd HH:mm:ss").getTime();
}
}