Java Time Format getGenerationTime(String format)

Here you can find the source of getGenerationTime(String format)

Description

generate current time

License

Open Source License

Parameter

Parameter Description
format a parameter

Declaration

public static String getGenerationTime(String format) 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;
import java.util.Locale;

public class Main {
    /**/*from   ww w. ja  v  a2  s .  c o m*/
     * generate current time
     * 
     * @param format
     * @return
     */
    public static String getGenerationTime(String format) {
        SimpleDateFormat formatter = new SimpleDateFormat(format, Locale.US);
        String sysdate = formatter.format(new Date());
        return sysdate;
    }
}

Related

  1. getFormatTime(Date date)
  2. getFormatTime(String format)
  3. getFormatTimeString(Date date, String pattern)
  4. getFullDateTimeFormat()
  5. getFullTime(String format, Date date)
  6. getIntegerDateTime(Date date, String dateFormat)
  7. getShowTime(Date date, String format)
  8. getStartTimeFormatter()
  9. getStrDateByFormat(Date time, String format)