date to str
new SimpleDateFormat("yyyyMMdd-hhmmss").format(Calendar.getInstance().getTime());
str to date
new SimpleDateFormat("yyyyMMdd-hhmmss").parse(str);