String time = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss").format(new Date().getTime()); System.out.println(time);