Commit 121ba2a6 authored by fangxinjiang's avatar fangxinjiang

工具类调整

parent b95ca88a
......@@ -107,6 +107,7 @@
<module>yifu-msg</module>
<module>yifu-permission</module>
<module>yifu-ekp</module>
<module>yifu-nginx-log</module>
</modules>
<dependencyManagement>
......
......@@ -73,6 +73,10 @@ public class DateUtil {
* yyyy-MM-dd hh:mm:ss
*/
public static final String DATETIME_PATTERN_MINUTE = "yyyy-MM-dd HH:mm";
/**
* yyyy-MM-dd-hh
*/
public static final String DATETIME_PATTERN_HOUR = "yyyyMMddHH";
/**
* yyyyMMddHHmmss
*/
......@@ -478,6 +482,20 @@ public class DateUtil {
return cal.getTime();
}
/**
* @param date
* @param mnt
* @return java.util.Date
*/
public static String dateIncreaseByHour(Date date, int mnt, String fmt) {
Calendar cal = GregorianCalendar.getInstance(TimeZone.getTimeZone("GMT"));
cal.setTime(date);
cal.add(Calendar.HOUR, mnt);
return dateToString(cal.getTime(), fmt);
}
/**
* @param date
* @param mnt
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment