Java Today getToday(String format)

Here you can find the source of getToday(String format)

Description

get Today

License

Open Source License

Declaration

public static String getToday(String format) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String getToday(String format) {
        String result = "";
        try {/*from   w w  w  . j av a  2  s  .c om*/
            Date today = new Date();
            SimpleDateFormat simpleFormat = new SimpleDateFormat(format);
            result = simpleFormat.format(today);
        } catch (Exception e) {
        }
        return result;
    }
}

Related

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