Java Date to String DateToString(Date thisdate, Locale locale)

Here you can find the source of DateToString(Date thisdate, Locale locale)

Description

Date To String

License

Open Source License

Declaration

public static String DateToString(Date thisdate, Locale locale) 

Method Source Code

//package com.java2s;
/*// w w w  . j ava  2  s  .  c o  m
 * B3P Commons Core is a library with commonly used classes for webapps.
 * Included are clieop3, oai, security, struts, taglibs and other
 * general helper classes and extensions.
 *
 * Copyright 2000 - 2008 B3Partners BV
 * 
 * This file is part of B3P Commons Core.
 * 
 * B3P Commons Core 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.
 * 
 * B3P Commons Core 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.
 * 
 * You should have received a copy of the GNU General Public License
 * along with B3P Commons Core.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.util.Locale;
import java.util.Date;

import java.text.SimpleDateFormat;

public class Main {
    public static String DateToString(Date thisdate, Locale locale) {
        if (thisdate != null) {
            SimpleDateFormat sdf = (SimpleDateFormat) SimpleDateFormat.getDateInstance();
            sdf.applyPattern("dd-MM-yyyy");
            return sdf.format(thisdate);
        } else {
            return "";
        }
    }
}

Related

  1. dateToString(Date fecha)
  2. DateToString(Date fecha, String formato)
  3. dateToString(Date pd_fecha)
  4. dateToString(Date pDate, String pFormat)
  5. dateToString(Date pdttValue, String pstrDateFormat)
  6. dateToString(final Date date)
  7. dateToString(final Date value, final boolean utc)
  8. dateToString(java.util.Date currdate, String strFormat)
  9. dateToString(String date, String format)