Here you can find the source of getCurrentDate()
protected static String getCurrentDate()
//package com.java2s; /**/*www . j a va2 s . co m*/ * Copyright (c) 2014-present Jonathan McCann * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. */ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final ThreadLocal<DateFormat> _DATE_FORMAT = new ThreadLocal<DateFormat>() { @Override protected DateFormat initialValue() { return new SimpleDateFormat("MM/dd/yyyy"); } }; protected static String getCurrentDate() { DateFormat dateFormat = _DATE_FORMAT.get(); return dateFormat.format(new Date()); } }