public class TimeProcessor {
public TimeProcessor() {
}
public static String getCurrentTime(String format) {
java。
util。Date date = new java。util。Date();
return date2String(date, format);
}
public static java。util。Date string2Date(String dateStr, String format) throws
Exception {
if (dateStr == null || format == null)
{
{
throw new Exception("日期转换失败:dateStr or format is null");
}
}
try
{
SimpleDateFormat dateFormater = new SimpleDateFormat(format);
return rse(dateStr);
}
catch (Exception e)
{
throw e;
}
}
}
String nineTime = new StringBuffer(TimeProcessor
。
getCurrentTime("yyyyMMdd"))。append("090000")。
toString();
Date nineDate = ring2Date(nineTime,
"yyyyMMddHHmmss");
String currentTime = tCurrentTime();
Date currentDate = ring2Date(currentTime,
"yyyyMMddHHmmss");
Calendar nineCalendar = tInstance();
Calendar currentCalendar = tInstance();
tTime(nineDate);
tTime(currentDate);
//进行早上9点操作判断
if( fore(nineCalendar)) {
// do your work
}else {
}
。
全部