Java Now now(String formatStr)

Here you can find the source of now(String formatStr)

Description

now

License

Open Source License

Declaration

public static String now(String formatStr) 

Method Source Code


//package com.java2s;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static String now(String formatStr) {
        Date date = new Date();
        DateFormat format = new SimpleDateFormat(formatStr);
        return format.format(date);
    }//w w w  .j a  va2s .co  m
}

Related

  1. now()
  2. now(String dateFormat)
  3. now(String dateFormat)
  4. now(String dateFormat)
  5. now(String dateFormat)
  6. now(String pattern)
  7. now(String s, Date date)
  8. now_TimeZone_BY()
  9. nowAs14CharString()