|
@@ -15,6 +15,16 @@ public class DateUtil {
|
|
|
|
|
|
private static final String[] WEEK_DAYS_MIDDLE = {"周日", "周一", "周二", "周三", "周四", "周五", "周六"};
|
|
|
|
|
|
+ public static final String DADE_FROMAT_YMD = "yyyy-MM-dd";
|
|
|
+
|
|
|
+ public static final String DADE_FROMAT_YMDHMS = "yyyy-MM-dd HH:mm:ss";
|
|
|
+
|
|
|
+ public static final String DADE_FROMAT_CYMD = "yyyy年M月d日";
|
|
|
+
|
|
|
+ public static final String DADE_FROMAT_CYMDHM = "yyyy年M月d日 HH:mm";
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 将时间戳转换成日期字符串格式
|
|
|
* @param timestamp 时间戳
|
|
@@ -215,7 +225,16 @@ public class DateUtil {
|
|
|
return calendar.getTime();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 将时间戳转换成日期字符串格式
|
|
|
+ *
|
|
|
+ * @param timestamp 时间戳
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static String convertTimestampToDateString(long timestamp) {
|
|
|
+ Date date = new Date(timestamp);
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat(DADE_FROMAT_YMDHMS);
|
|
|
+ return sdf.format(date);
|
|
|
+ }
|
|
|
|
|
|
}
|