Java Time Format getCurTime(String dateformat)

Here you can find the source of getCurTime(String dateformat)

Description

get Cur Time

License

Open Source License

Declaration

public static String getCurTime(String dateformat) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {

    public static String getCurTime(String dateformat) {
        Calendar calendar = new GregorianCalendar();
        Date date = calendar.getTime();
        SimpleDateFormat format = new SimpleDateFormat(dateformat);
        return format.format(date);
    }/*from   www. jav a  2  s. c  o m*/
}

Related

  1. formatVideoRecordingTime(long t)
  2. getCalendarByDateTime(int dateTime, String dateFormat)
  3. getCurDateTime(String formatStr)
  4. getCurDateTimeFormat(String Format)
  5. getCurrDatetimeWithDbFormat()
  6. getDefaultDatetimeFormat()
  7. getDefaultPropertyPageDateTimeFormat()
  8. getEndDate(String time, SimpleDateFormat dateFormat)
  9. getFormat2TimetagStr()