Java Today getTodayTime()

Here you can find the source of getTodayTime()

Description

get Today Time

License

Open Source License

Declaration

public static String getTodayTime() 

Method Source Code


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

import java.text.FieldPosition;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String getTodayTime() {
        return getDate(new Date(), "yyyy.MM.dd HH:mm:ss");
    }//from  w  w  w  .ja  v a  2s . co m

    public static String getDate(Date pDate, String pFormat) {

        if (pDate == null)
            return "";

        StringBuffer ret = new StringBuffer();
        new SimpleDateFormat(pFormat).format(pDate, ret, new FieldPosition(0));
        return ret.toString();
    }
}

Related

  1. getTodayStr()
  2. getTodayString()
  3. getTodayString()
  4. getTodayString()
  5. getTodayString()
  6. getTodayTimeForDB()
  7. getTodayWithTime(final String iTime)
  8. getTodayYmd()
  9. getTodayYMD()