Java Today today()

Here you can find the source of today()

Description

today

License

Apache License

Declaration

public static Calendar today() 

Method Source Code

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

import java.util.Calendar;
import java.util.GregorianCalendar;

public class Main {
    public static Calendar today() {
        return date(now());
    }/* w w w.j  av  a  2 s .  c om*/

    public static Calendar date(int day, int month, int year) {
        return new GregorianCalendar(year, month - 1, day);
    }

    public static Calendar date(Calendar dateTime) {
        Calendar date = (Calendar) dateTime.clone();
        date.set(Calendar.HOUR_OF_DAY, 0);
        date.set(Calendar.MINUTE, 0);
        date.set(Calendar.SECOND, 0);
        date.set(Calendar.MILLISECOND, 0);
        return date;
    }

    public static Calendar now() {
        return Calendar.getInstance();
    }
}

Related

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