Java Date to String dateToStringShort(Date date)

Here you can find the source of dateToStringShort(Date date)

Description

date To String Short

License

Open Source License

Declaration

public static String dateToStringShort(Date date) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

public class Main {

    public static String dateToStringShort(Date date) {
        if (date == null)
            return "";
        return FormatDate(date, "yyyy-MM-dd");
    }//  ww  w .  j  av  a 2s.c om

    public static String FormatDate(Date date, String sf) {
        if (date == null)
            return "";
        SimpleDateFormat dateformat = new SimpleDateFormat(sf);
        return dateformat.format(date);
    }
}

Related

  1. dateToString1(Date date, String formatIn)
  2. dateToString_yyyyMMddHHmmssSSS(Date date)
  3. DateToStringByformat2(Date date)
  4. dateToStringFecha(Date fecha)
  5. dateToStringFormat(Date dt, String format)
  6. dateToStringTemporalCoverage(Date date)
  7. dateToStringVerbose(Date date)
  8. dateToStringWithFormat(Date dateToString, String dateFormat)
  9. dateToStringWithPattern(Date date, String pattern)