Java Today todaysTime()

Here you can find the source of todaysTime()

Description

Get today's time in format DD-MMM-YYYY-HH:MM:SS

License

Open Source License

Declaration

public static String todaysTime() throws Throwable 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**/*from   w w w.  j a va  2 s . c  o m*/
     * Get today's time in format DD-MMM-YYYY-HH:MM:SS
     */
    public static String todaysTime() throws Throwable {
        Date date = new Date();
        SimpleDateFormat formatterOut = null;
        formatterOut = new SimpleDateFormat("dd-MMM-yyyy-HH:mm:ss");
        return formatterOut.format(date);
    }
}

Related

  1. todayPlusDays(int days)
  2. toDaysBeforeOrAfter(Date date, Integer days)
  3. todaysDate(int style)
  4. todaySortedTimestamp()
  5. todayStart()
  6. todayStr()
  7. todayString(final String sFormat)
  8. translateToDayNumber(int y, int m, int d)