Java Today today()

Here you can find the source of today()

Description

today

License

Apache License

Declaration

public static String today() 

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 today() {
        return datetimeToStr(new Date()).substring(0, 8);
    }/*from   w w w . j a  va 2 s.c  om*/

    // ===============================================================
    public static String datetimeToStr(Date dtSource) {
        // 'yyyy-mm-dd hh:nn:ss'
        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
        return formatter.format(dtSource);
    }
}

Related

  1. today()
  2. today()
  3. today()
  4. today()
  5. today()
  6. toDay(final String dateString)
  7. today(String format)
  8. today(String pattern)
  9. today(String strFormat)