Java Day getDateYYMMDD(java.util.Date date)

Here you can find the source of getDateYYMMDD(java.util.Date date)

Description

get Date YYMMDD

License

Apache License

Declaration

public static String getDateYYMMDD(java.util.Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String getDateYYMMDD(java.util.Date date) {
        if (date == null)
            return "";
        SimpleDateFormat formatter = new SimpleDateFormat("yyMMdd");
        String NDate = formatter.format(date);
        return NDate;
    }/* ww w.j  ava2s  .  c  o  m*/

    public static String getDateYYMMDD() {
        SimpleDateFormat formatter = new SimpleDateFormat("yyMMdd");
        String NDate = formatter.format(new Date());
        return NDate;
    }

    public static String format(Date date) {
        return format(date, "yyyy-MM-dd HH:mm:ss");
    }

    public static String format(Date date, String pattern) {
        return new SimpleDateFormat(pattern).format(date);
    }
}

Related

  1. daySub(Date fDate, Date oDate)
  2. daysWeekName(boolean shortName, Locale locale)
  3. dayToMilliSeconds(String day, String timeZone)
  4. dayToUTCSeconds(String day)
  5. getDateYYMMDD()
  6. getDay(Date date)
  7. getDay(Date date)
  8. getDay(Date date)
  9. getDay(Date date)