Java Today getToday()

Here you can find the source of getToday()

Description

get Today

License

Open Source License

Declaration

public static Date getToday() 

Method Source Code

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

import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

public class Main {
    public static Date getToday() {
        Calendar cal = getCalendar();
        return cal.getTime();
    }/*from   ww  w . j  a  v a2s .  c o  m*/

    public static Date getToday(String timezone) {
        return getCalendar(timezone).getTime();
    }

    public static Calendar getCalendar() {
        return getCalendar("GMT");
    }

    public static Calendar getCalendar(String timezone) {
        Calendar cal = Calendar.getInstance();
        cal.setTimeZone(TimeZone.getTimeZone(timezone));

        return cal;
    }
}

Related

  1. getToday()
  2. getToday()
  3. getToday()
  4. getToday()
  5. getToday()
  6. getToday()
  7. getToday()
  8. getToday()
  9. getToday(boolean ceOrTw, String deli)