Java Date Format As getDateYYYYMMDD()

Here you can find the source of getDateYYYYMMDD()

Description

get Date YYYYMMDD

License

Apache License

Declaration

public static String getDateYYYYMMDD() 

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 getDateYYYYMMDD() {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
        String NDate = formatter.format(new Date());
        return NDate;
    }/*from  w  w  w. jav  a  2s .  c  o  m*/

    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. formatddMMyyyy(Date date)
  2. getDateAsISO8601String(Date date)
  3. getDateAsISO8601String(Date date)
  4. getDateAsISOTimestampString(Date timestamp)
  5. getDateAsRFC822String(Date date)
  6. getDateYYYYMMDD(Object yyyymmdd)
  7. getDateYYYYMMDD_HHSSMMNNN()
  8. getDateYyyyMmWithoutDash()