Java Time Now getNow()

Here you can find the source of getNow()

Description

get Now

License

Apache License

Declaration

public static Date getNow() 

Method Source Code

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

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static Date getNow() {
        Date now = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        try {//from   ww  w  . j  av a  2  s.  com
            return dateFormat.parse(dateFormat.format(now));
        } catch (ParseException e) {
            return null;
        }
    }
}

Related

  1. getNow()
  2. getNow()
  3. getNow()
  4. getNow()
  5. getNow()
  6. getNow()
  7. getNow()
  8. getNow()
  9. getNow()