标签:list led gif ini otl span hide arraylist div
/** *获取对应日期的288个时刻点 two hundred and eighty-eight *@date 2017-11-24 下午4:06:14 *@author Administrator (chenrd) */ public static List<String> getTwoHundredAndEightyEightTime(String tjrq){ List<String> rqs = new ArrayList<String>(); for(int i=0;i<24;i++){ if(i<10){ rqs.add(tjrq +" 0"+i+":00:00"); rqs.add(tjrq +" 0"+i+":05:00"); rqs.add(tjrq +" 0"+i+":10:00"); rqs.add(tjrq +" 0"+i+":15:00"); rqs.add(tjrq +" 0"+i+":20:00"); rqs.add(tjrq +" 0"+i+":25:00"); rqs.add(tjrq +" 0"+i+":30:00"); rqs.add(tjrq +" 0"+i+":35:00"); rqs.add(tjrq +" 0"+i+":40:00"); rqs.add(tjrq +" 0"+i+":45:00"); rqs.add(tjrq +" 0"+i+":50:00"); rqs.add(tjrq +" 0"+i+":55:00"); }else{ rqs.add(tjrq +" "+i+":00:00"); rqs.add(tjrq +" "+i+":05:00"); rqs.add(tjrq +" "+i+":10:00"); rqs.add(tjrq +" "+i+":15:00"); rqs.add(tjrq +" "+i+":20:00"); rqs.add(tjrq +" "+i+":25:00"); rqs.add(tjrq +" "+i+":30:00"); rqs.add(tjrq +" "+i+":35:00"); rqs.add(tjrq +" "+i+":40:00"); rqs.add(tjrq +" "+i+":45:00"); rqs.add(tjrq +" "+i+":50:00"); rqs.add(tjrq +" "+i+":55:00"); } } return rqs; }
扩展
/** *获取一段时间对应日期的288个时刻点 two hundred and eighty-eight *@author Administrator (chenrd) *@date 2018-1-17 上午11:27:20 */ public static List<String> getTwoHundredAndEightyEightTime(String kssj,String jssj) throws Exception{ List<String> rqs = new ArrayList<String>(); List<String> tempRqs ; Calendar ksc = Calendar.getInstance(); Calendar jsc = Calendar.getInstance(); ksc.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(kssj)); jsc.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(jssj)); //相差的天数 long totleDay = (jsc.getTimeInMillis()-ksc.getTimeInMillis())/(24*60*60*1000); for(int i=0;i<=totleDay;i++){ tempRqs = getTwoHundredAndEightyEightTime(new SimpleDateFormat("yyyy-MM-dd").format(ksc.getTime())); ksc.add(Calendar.DATE, 1); rqs.addAll(tempRqs); } return rqs; }
标签:list led gif ini otl span hide arraylist div
原文地址:https://www.cnblogs.com/rdchen/p/14211937.html