Here you can find the source of formattedTimeForFilenames()
public static String formattedTimeForFilenames()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String formattedTimeForFilenames() { SimpleDateFormat sdf = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss"); return sdf.format(new Date()); }// w w w . j a v a 2s .c o m }