Java Time Now getNow()

Here you can find the source of getNow()

Description

get Now

License

Open Source License

Declaration

public static Date getNow() 

Method Source Code

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

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

public class Main {
    public static Date getNow() {
        return new Date();
    }//from   w  w w  .  jav a  2s.com

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

    public static String format(Date date, String pattern) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
        return simpleDateFormat.format(date);
    }
}

Related

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