Java Now getStringOfNowDate(String fFormatStr)

Here you can find the source of getStringOfNowDate(String fFormatStr)

Description

get String Of Now Date

License

Apache License

Parameter

Parameter Description

Declaration

public static String getStringOfNowDate(String fFormatStr) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

public class Main {

    public static String getStringOfNowDate(String fFormatStr) {
        String nowDateString = dateTypeToString(new Date(), fFormatStr);
        return nowDateString;
    }//from   www .j a v  a  2s.  co m

    public static String dateTypeToString(Date date, String fFormatStr) {
        //yyyy-MM-dd HH:mm:ss
        SimpleDateFormat dateformat = new SimpleDateFormat(fFormatStr);
        String strDate = dateformat.format(date);
        return strDate;
    }
}

Related

  1. getFormatNowDateTime(String formatStr)
  2. getFormattedDateNow(@Nonnull final String sFormat)
  3. getInviteCodeByNowDate()
  4. getShortNowTime()
  5. getStringNowTime()
  6. getTimeNow()
  7. getTimeNow(Date theTime)
  8. getTimeNowAsString(String pattern)
  9. getTimeSubFromNowTime(String time)