Java Today getTodayString()

Here you can find the source of getTodayString()

Description

returns Today in String (YYYYMMDD format)

License

Apache License

Declaration

public static String getTodayString() 

Method Source Code

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

import java.util.Date;

public class Main {
    /**/*from w w  w .ja v  a  2 s.c om*/
     * returns Today in String (YYYYMMDD format) 
     * 
     * @return
     */
    public static String getTodayString() {
        return getTodayInFormat("yyyyMMdd");
    }

    /**
     * getTodayInFormat
     * @param format
     * @return
     */
    public static String getTodayInFormat(String format) {
        Date td = new Date();
        java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat(format);
        String datenewformat = formatter.format(td);
        return datenewformat;
    }
}

Related

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