/**
* Get the seconds by the specified HH:mm:ss
*
* @param time the specified format time
*
* @return the total seconds.
*/
public static int getSecondByTime(String time)
{
StringTokenizer tok = new StringTokenizer(time, ":");
/**
* Get the interval date by specified start date and time
* @param d the start date
* @param time the interval time
* @param isAfter count the after date,otherwise cout before date
* @return
*/
public static Date getIntervalTime(Date d,String time,boolean isAfter)
{
try
{
Calendar c = java.util.Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
Date dCount = sdf.parse(time);
c.setTime(d);
if(isAfter)
c.add(Calendar.SECOND,getSecondByTime(time));
else
c.add(Calendar.SECOND,0-getSecondByTime(time));
return c.getTime();
//System.out.println(dCount.getHours());
//System.out.println(dCount.getSeconds());
//System.out.println(dCount.getMinutes());
}catch(java.text.ParseException e)
{
throw new MFUtilException("Translate date time faield:" + time);
}
}