Here you can find the source of getTodayString()
public static String getTodayString()
//package com.java2s; //License from project: Apache License import java.util.Date; public class Main { /**/*from w w w .ja v a 2 s.c om*/ * returns Today in String (YYYYMMDD format) * * @return */ public static String getTodayString() { return getTodayInFormat("yyyyMMdd"); } /** * getTodayInFormat * @param format * @return */ public static String getTodayInFormat(String format) { Date td = new Date(); java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat(format); String datenewformat = formatter.format(td); return datenewformat; } }