Commit f66593f9 authored by yanzg's avatar yanzg

接口文档的支持

parent 0b28c274
...@@ -18,6 +18,7 @@ import java.util.Date; ...@@ -18,6 +18,7 @@ import java.util.Date;
public class DateHelper { public class DateHelper {
private static final String FORMAT_DAY_STRING = "yyyy-MM-dd"; private static final String FORMAT_DAY_STRING = "yyyy-MM-dd";
private static final String FORMAT_DAY_HOUR_STRING = "yyyy-MM-dd HH:00:00";
private static final String FORMAT_SECOND_STRING = "yyyy-MM-dd HH:mm:ss"; private static final String FORMAT_SECOND_STRING = "yyyy-MM-dd HH:mm:ss";
private static final int MONTH_1 = 1; private static final int MONTH_1 = 1;
private static final int MONTH_2 = 2; private static final int MONTH_2 = 2;
...@@ -155,6 +156,45 @@ public class DateHelper { ...@@ -155,6 +156,45 @@ public class DateHelper {
return getYearMonthDay(date); return getYearMonthDay(date);
} }
/**
* 获取日期 yyyy-MM-dd HH:00:00
*
* @param date 日期参数
* @return 返回的结果
*/
public static String getYearMonthDayHour(Date date) {
return getDate(date, FORMAT_DAY_HOUR_STRING);
}
/**
* 取得当前日期的字符串表示,格式为 yyyy-MM-dd HH:00:00
*
* @return 返回日期的字符串表示
*/
public static String getTodayHour() {
return getYearMonthDayHour(getCurDate());
}
/**
* 取得当前日期的字符串表示,格式为 yyyy-MM-dd HH:00:00
*
* @param date
* @return
*/
public static String getTodayHour(Object date) {
return getYearMonthDayHour(DateHelper.getDateTime(date));
}
/**
* 取得当前日期的字符串表示,格式为 yyyy-MM-dd HH:00:00
*
* @param date
* @return
*/
public static String getTodayHour(Date date) {
return getYearMonthDayHour(date);
}
/** /**
* 获取年份 * 获取年份
* *
......
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