Java Timestamp Format formatCurrentDateTimeStamp(final String dateFormatString)

Here you can find the source of formatCurrentDateTimeStamp(final String dateFormatString)

Description

Supplies Current Date in the given dateFormat.

License

Open Source License

Parameter

Parameter Description
dateFormatString pattern for the date format.

Return

date string representation of the date.

Declaration

public static String formatCurrentDateTimeStamp(final String dateFormatString) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**/*  ww w  . j  a  v  a 2 s .c  o m*/
     * Supplies Current Date in the given dateFormat.
     * 
     * @param dateFormatString
     *             pattern for the date format.
     * 
     * @return date
     *             string representation of the date.
     */
    public static String formatCurrentDateTimeStamp(final String dateFormatString) {
        String tmpString = "";

        SimpleDateFormat format = new SimpleDateFormat(dateFormatString);
        tmpString = format.format(new Date());

        return tmpString;
    }
}

Related

  1. format(Timestamp time)
  2. format2AdwordsTimestamp(Date date)
  3. format8chars(long timestamp)
  4. formataDataHoraMinuto(Timestamp dataHora)
  5. formatCalendar(Timestamp stamp)
  6. formatDataTime(Timestamp intime)
  7. formatDate(Date date, String pattern)
  8. formatDate(Date date, String pattern)
  9. formatDate(java.sql.Timestamp timestamp)