public class Main {
public static void main(String[] args) throws IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException, ParseException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy:MM:dd-HH:mm:ss");
Date date = simpleDateFormat.parse("2018:3:17-13:32:11");//把满足sdf日期格式的时间字符串转换为Date类型
System.out.println(date);
long time = date.getTime();//得到这个时间距离1970年的毫秒数
Date date1 = new Date(time+1000);//多一秒
System.out.println(date1);
}
}