Here you can find the source of getToday()
public static long getToday()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { private final static ThreadLocal<SimpleDateFormat> dateFormater2 = new ThreadLocal<SimpleDateFormat>() { @Override// ww w . j a v a 2s .c om protected SimpleDateFormat initialValue() { return new SimpleDateFormat("yyyy-MM-dd"); } }; public static long getToday() { Calendar cal = Calendar.getInstance(); String curDate = dateFormater2.get().format(cal.getTime()); curDate = curDate.replace("-", ""); return Long.parseLong(curDate); } }