Java Date Now currentDate(String format, Locale locale)

Here you can find the source of currentDate(String format, Locale locale)

Description

current Date

License

Open Source License

Declaration

public static String currentDate(String format, Locale locale) 

Method Source Code


//package com.java2s;
/* ==========================================
 * CategorizeUserForum : a free Java graph-theory library
 * ==========================================
 * // w w w. j av  a 2  s . co m
 * salmuz : Carranza Alarcon Yonatan Carlos
 * 
 * (C) Copyright 2014, by salmuz and Contributors.
 * 
 * Project Info:  https://github.com/salmuz/Graphes_Multi_Plateformes
 * Project Creator:  salmuz (https://www.assembla.com/spaces/salmuz-java) 
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library 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 Lesser General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library; if not, write to the Free Software Foundation,
 * Inc.,
 * 
 * ------------------
 * Point.java
 * ------------------
 * (C) Copyright 2014, by salmuz and Contributors
 *
 * Original Author: Carranza Alarcon Yonatan Carlos
 * Contributor(s):  
 *
 * Changes
 * -------
 *
 */

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class Main {
    public static String currentDate(String format, Locale locale) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format, locale);
        simpleDateFormat.setLenient(false);
        return simpleDateFormat.format(new Date());
    }
}

Related

  1. currentDate()
  2. currentDate()
  3. currentDate()
  4. currentDate(int dateStyle)
  5. currentDate(String format)
  6. currentDate(String format, String locale)
  7. currentDate2String()
  8. currentDate2String()
  9. currentDate_DDMMYY()