Java Now nowDT()

Here you can find the source of nowDT()

Description

now DT

License

LGPL

Declaration

public static String nowDT() 

Method Source Code

//package com.java2s;
//License from project: LGPL 

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

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

    public static String nowDT() {

        return formatDT(FMT_DEFAULT);
    }/*from   w w w.  j  ava2  s .  c om*/

    public static String formatDT(String fmt) {

        return formatDT(fmt, new Date());
    }

    public static String formatDT(String fmt, Date date) {

        return new SimpleDateFormat(fmt).format(date);
    }
}

Related

  1. nowDateString()
  2. nowDateString()
  3. nowDateString(String format)
  4. nowDateToString()
  5. nowDT()
  6. nowFile()
  7. nowFormat(String format)
  8. nowFormat(String format)
  9. nowIdentity()