Java Date Format As formatDateToday()

Here you can find the source of formatDateToday()

Description

format Date Today

License

Open Source License

Declaration

public static String formatDateToday() 

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 FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");

    public static String formatDateToday() {
        return formatDate(new Date());
    }//from w  w w  . ja  v  a2  s .com

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

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

Related

  1. formatDateMonth(Date d)
  2. formatDateRfc822(Date date)
  3. formatDateStamp(final Date date)
  4. formatDateSwedish(Date date)
  5. formatDateTd(Object obj)
  6. formatDateToDefault(Date date)
  7. formatDateToMD(Date date)
  8. formatDateToMinutes(Date date)
  9. formatDateToUTC(Date date)