Java Today getAllToday()

Here you can find the source of getAllToday()

Description

get All Today

License

Open Source License

Declaration

public static String getAllToday() 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static String defaultDatePattern = "yyyy-MM-dd";
    public static String defaultDatePattern1 = "yyyy-MM-dd HH:mm:ss";

    public static String getAllToday() {
        Date today = new Date();
        return formatAllDate(today);
    }/*from  www .j a v  a  2s .  c o  m*/

    public static String formatAllDate(Date date) {
        return format(date, defaultDatePattern1);
    }

    public static String format(Date date) {
        return format(date, getDatePattern());
    }

    public static String format(Date date, String pattern) {
        String returnValue = "";

        if (date != null) {
            SimpleDateFormat df = new SimpleDateFormat(pattern);
            returnValue = df.format(date);
        }

        return (returnValue);
    }

    public static String getDatePattern() {
        return defaultDatePattern;
    }
}

Related

  1. deletePreviousDay(Calendar today, String temppath)
  2. endOfToday()
  3. formatToday()
  4. formatToday()
  5. formatToDays(Date date)
  6. getBetweenTodaysStartDateAndEndDate(Date startDate, Date endDate)
  7. getCalendarTodayZero(Calendar today)
  8. getEndOfToday()
  9. getFirstDate(Date today)