Java Today getToday()

Here you can find the source of getToday()

Description

get Today

License

Open Source License

Declaration

public static String getToday() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final String _8DIGIT_DATE_2 = "yyyy-MM-dd";

    public static String getToday() {
        SimpleDateFormat sdf = new SimpleDateFormat(_8DIGIT_DATE_2);

        return sdf.format(new Date());
    }/*from  w w  w  . j  a  v a  2  s.  c o m*/

    public static String format(Date aDate, String type) {
        SimpleDateFormat sdf = new SimpleDateFormat(type);

        return sdf.format(aDate);
    }

    public static String format(Long dateMs, String type) {
        Date date = new Date(dateMs);
        SimpleDateFormat sdf = new SimpleDateFormat(type);
        return sdf.format(date);
    }
}

Related

  1. getToday()
  2. getToday()
  3. getToday()
  4. getToday()
  5. getToday()
  6. getToday()
  7. getToday()
  8. getToday()
  9. getToday()