| | |
| | | |
| | | public final static String DATE_TIME_PATTERN_STRING = "yyyyMMddHHmmss"; |
| | | |
| | | public static final String FORMAT_SIMPLE_TIME = "HH:mm"; |
| | | |
| | | /** |
| | | * 日期格式化 日期格式为:yyyy-MM-dd |
| | | * @param date 日期 |
| | |
| | | return days; |
| | | } |
| | | |
| | | public static List<String> getTimeScale(Date startDate, Date endDate, int seconds, String timeFormat) { |
| | | List<String> days = new ArrayList<String>(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(startDate); |
| | | while (calendar.getTime().compareTo(endDate) <= 0) { |
| | | days.add(DateUtils.format(calendar.getTime(), timeFormat)); |
| | | calendar.add(Calendar.SECOND, seconds); |
| | | } |
| | | return days; |
| | | } |
| | | |
| | | /** |
| | | * 对日期的【秒】进行加/减 |
| | | * |