Java Time Now getNow()

Here you can find the source of getNow()

Description

get Now

License

Apache License

Declaration

public static String getNow() 

Method Source Code

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

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {

    public static String getNow() {
        return getNow("yyyy-MM-dd");
    }//from   ww w .  j a  v  a  2s  .  co  m

    public static String getNow(String pattern) {
        Calendar now = Calendar.getInstance();
        SimpleDateFormat format = new SimpleDateFormat(pattern);
        return format.format(now.getTime());
    }
}

Related

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