Java Now now()

Here you can find the source of now()

Description

now

License

Open Source License

Declaration

public static String now() 

Method Source Code


//package com.java2s;
import java.util.Calendar;
import java.text.SimpleDateFormat;

public class Main {
    public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss";

    public static String now() {
        Calendar cal = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
        return sdf.format(cal.getTime());
    }//from   w  w w .  j av  a  2 s.  c  o m
}

Related

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