Java Today getToday()

Here you can find the source of getToday()

Description

get Today

License

Open Source License

Declaration

public static String getToday() 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    private static String defaultDatePattern = "yyyy-MM-dd";

    public static String getToday() {
        Date today = new Date();
        return format(today);
    }/*from w w  w  .  ja v  a 2 s.c  o m*/

    public static String format(Date date) {
        return date == null ? "" : format(date, getDatePattern());
    }

    public static String format(Date date, String pattern) {
        return date == null ? "" : new SimpleDateFormat(pattern).format(date);
    }

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

Related

  1. GetToday()
  2. getToday()
  3. getToday()
  4. getToday()
  5. getToday()
  6. getToday(boolean ceOrTw, String deli)
  7. getToDay(boolean withTime)
  8. getToday(int hour, int minute, int second)
  9. getToday(String datePattern)