Java Time Now getNow()

Here you can find the source of getNow()

Description

get Now

License

Open Source License

Declaration

public static String getNow() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String getNow() {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date today = new Date();
        return format.format(today);
    }//from   w  w  w  .j  a va 2s  .  co  m

    public static String getNow(String fmt) {
        SimpleDateFormat format = new SimpleDateFormat(fmt);
        Date today = new Date();
        return format.format(today);
    }
}

Related

  1. getNow()
  2. getNow()
  3. getNow()
  4. getNow()
  5. getNow()
  6. getNow()
  7. getNow()
  8. getNow(boolean ifdatetime)
  9. getNow(final String format)