Java Time Now getNowInputDate()

Here you can find the source of getNowInputDate()

Description

get now day format : yyyyMMdd

License

Open Source License

Declaration

public static String getNowInputDate() 

Method Source Code


//package com.java2s;
import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final String DATE_FORMAT_INPUT_PAGE = "yyyyMMdd";

    /**//from  www  .  j a  v  a 2s . c  o m
     * get now day format : yyyyMMdd
     * 
     * @return
     */
    public static String getNowInputDate() {
        return timeToString(DATE_FORMAT_INPUT_PAGE, new Date());
    }

    public static String timeToString(String format, Date date) {
        DateFormat df = new SimpleDateFormat(format);
        return df.format(date);
    }
}

Related

  1. getNowFileFormat()
  2. getNowFormatLog()
  3. getNowFormattedDateTimeStr(String pattern)
  4. getNowHour()
  5. getNowInBanFormat()
  6. getNowOfDateByFormat(String format)
  7. getNowPatch()
  8. getNowSinceHour()
  9. getNowStr()