Java Time Now getNow(final String format)

Here you can find the source of getNow(final String format)

Description

get Now

License

Open Source License

Declaration

static public String getNow(final String format) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    static public String getNow() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return sdf.format(new Date());

    }//from  w  ww .  j a v  a  2  s . com

    static public String getNow(final String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(new Date());

    }
}

Related

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