Java yyyy formatStr(Date date)

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

Description

format Str

License

Open Source License

Declaration

public static String formatStr(Date date) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public final static String DEFAULT_YMD_FORMAT = "yyyy-MM-dd";

    public static String formatStr(Date date) {
        SimpleDateFormat sdf = new SimpleDateFormat(DEFAULT_YMD_FORMAT);
        if (date == null) {
            return "";
        }//from w  ww .j a va2  s .  co m
        return sdf.format(date);
    }
}

Related

  1. formatRTGSDate(java.util.Date date)
  2. formatShortDate(Date date)
  3. formatSimpleDate(Date date)
  4. formatSimpleGermanDateString(Date date)
  5. formatSpaydDate(Date date, TimeZone tz)
  6. formatString(Date date)
  7. formattedDate(final String format, final Date tweetPollDate)
  8. formatter()
  9. formatTimeSpan(long time)