Here you can find the source of getTodayString()
public static String getTodayString()
//package com.java2s; //License from project: Apache License import java.text.*; import java.util.*; public class Main { /**/*from www . j a v a 2 s .c o m*/ * return a string of todays date suitable for use in a file name * * @return */ public static String getTodayString() { SimpleDateFormat sdf = new SimpleDateFormat("dd_MMM_yyyy"); // -> 05:08:56 AM final String dateText = sdf.format(new Date()); return dateText; } }