Java Year Format getYYYYMMDDHH(Date date)

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

Description

get YYYYMMDDHH

License

Open Source License

Declaration

public static String getYYYYMMDDHH(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 {
    private static final SimpleDateFormat DATE_FORMAT2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    private static final SimpleDateFormat DATE_FORMAT3 = new SimpleDateFormat("yyyy-MM-dd HH");

    public static String getYYYYMMDDHH(Date date) {
        return DATE_FORMAT3.format(date);
    }//from  w w w . ja v a2  s  .  c o m

    public static String format(Date date) {
        return DATE_FORMAT2.format(date);
    }
}

Related

  1. getYYYYMMDD(Date date)
  2. getYYYYMMDD(int y, int m, int d)
  3. getYyyyMMddDate(String s)
  4. getyyyyMMddDateStr(Date date)
  5. getYYYYMMDDFormat()
  6. getYYYYMMDDHHMISS()
  7. getYYYYMMDDHHMMSS()
  8. getYYYYMMDDHHMMSS(Date date)
  9. getYyyyMMddWithoutDate()