Java Date Now getCurrentDate()

Here you can find the source of getCurrentDate()

Description

get Current Date

License

Open Source License

Declaration

protected static String getCurrentDate() 

Method Source Code

//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());
    }
}

Related

  1. getCurrentDate()
  2. getCurrentDate()
  3. GetCurrentDate()
  4. getCurrentDate()
  5. getCurrentDate()
  6. getCurrentDate()
  7. getCurrentDate()
  8. getCurrentDate()
  9. getCurrentDate()