Java Now nowTime(String formartStr)

Here you can find the source of nowTime(String formartStr)

Description

now Time

License

Open Source License

Declaration

public static String nowTime(String formartStr) 

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 String nowTime(String formartStr) {
        String strDate = null;/* w  w  w .  jav  a 2s. c  om*/
        if ((formartStr != null) && (!"".equals(formartStr))) {
            SimpleDateFormat sdf = new SimpleDateFormat(formartStr);
            strDate = sdf.format(new Date());
        }
        return strDate;
    }
}

Related

  1. nowIdentity()
  2. nowInBasicFormat()
  3. nowStr()
  4. nowString(String pattern)
  5. nowString(String pattern)
  6. nowTime(String format)
  7. printNow()
  8. stringDate(Date now)
  9. subNow()