Java Now now(String dateFormat)

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

Description

now

License

Open Source License

Declaration

public static String now(String dateFormat) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Calendar;

public class Main {
    public static String now(String dateFormat) {
        Calendar cal = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
        return sdf.format(cal.getTime());

    }//from  ww w .  ja va2  s .  c o m
}

Related

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