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 String GetToday() {
        Date cDate = new Date();

        SimpleDateFormat cSimpleDateFormat = new SimpleDateFormat(
                "yyyy-MM-dd");
        return cSimpleDateFormat.format(cDate);
    }/*ww w. j  ava 2  s.  c  om*/

    public static String GetToday(String strFormat) {
        Date cDate = new Date();

        SimpleDateFormat cSimpleDateFormat = new SimpleDateFormat(strFormat);
        return cSimpleDateFormat.format(cDate);
    }
}

Related

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