Java Time Now getNowTime()

Here you can find the source of getNowTime()

Description

get Now Time

License

Open Source License

Declaration

public static String getNowTime() 

Method Source Code


//package com.java2s;

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

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

    public static String getNowTime() {
        SimpleDateFormat df = new SimpleDateFormat(DATE_FULL_STR);
        return df.format(new Date());
    }//from  w ww  .jav a 2 s.  c  o m

    public static String getNowTime(String type) {
        SimpleDateFormat df = new SimpleDateFormat(type);
        return df.format(new Date());
    }
}

Related

  1. getNowString()
  2. getNowString(String pattern)
  3. getnowTime()
  4. getNowTime()
  5. getNowTime()
  6. getNowTime()
  7. getNowTime()
  8. getNowTime()
  9. getNowTime()