public class DateUtility extends Object
Constructor and Description |
---|
DateUtility() |
Modifier and Type | Method and Description |
---|---|
static int |
getCalendarField(Date d,
int field) |
static int |
getCalendarField(Date d,
int field,
Calendar cal) |
static Date |
getDate()
returns a date object based on the current time, but with the
milliseconds zeroed out.
|
static Date |
getDate(Calendar cal) |
static int |
getDate(Date d)
Returns the day of the month.
|
static int |
getDate(Date d,
Calendar cal)
Returns the day of the month.
|
static Date |
getDate(int year,
int month,
int date)
Returns a date object based on the default time zone and locale.
|
static Date |
getDate(int year,
int month,
int date,
Calendar cal)
Returns a date object based on the default time zone and locale.
|
static Date |
getDate(int year,
int month,
int date,
int hour,
int minute)
Returns a date object based on the default time zone and locale.
|
static Date |
getDate(int year,
int month,
int date,
int hour,
int minute,
Calendar cal)
Returns a date object based on the default time zone and locale.
|
static Date |
getDate(int year,
int month,
int date,
int hour,
int minute,
int second)
Returns a date object based on the default time zone and locale.
|
static Date |
getDate(int year,
int month,
int date,
int hour,
int minute,
int second,
Calendar cal)
Returns a date object based on the default time zone and locale.
|
static int |
getDay(Date d)
Returns the day of the week.
|
static int |
getHours(Date d,
Calendar cal) |
static int |
getMinutes(Date d,
Calendar cal) |
static int |
getMonth(Date d)
Returns the month number.
|
static int |
getMonth(Date d,
Calendar cal)
Returns the month number.
|
static int |
getSeconds(Date d,
Calendar cal) |
static int |
getYear(Date d)
Returns the year.
|
static int |
getYear(Date d,
Calendar cal)
Returns the year.
|
static int |
lastDayInMonth(int month,
int year)
Returns the last day of the month.
|
static int |
numberOfWeeks(int month,
int year) |
public static int lastDayInMonth(int month, int year)
public static int numberOfWeeks(int month, int year)
public static Date getDate(int year, int month, int date)
public static Date getDate(int year, int month, int date, Calendar cal)
public static Date getDate(int year, int month, int date, int hour, int minute)
public static Date getDate(int year, int month, int date, int hour, int minute, Calendar cal)
public static Date getDate(int year, int month, int date, int hour, int minute, int second)
public static Date getDate()
public static Date getDate(int year, int month, int date, int hour, int minute, int second, Calendar cal)
public static int getMonth(Date d)
public static int getMonth(Date d, Calendar cal)
public static int getYear(Date d)
public static int getDay(Date d)
public static int getDate(Date d)
public static int getCalendarField(Date d, int field)
Copyright © 2003, 2023, Oracle and/or its affiliates.