public class Date extends Object
| Constructor and Description |
|---|
Date(Calendar cal)
Creates a new Date instance with the specified Calendar.
|
| Modifier and Type | Method and Description |
|---|---|
Calendar |
getCalendar()
Gets the Calendar instance used by this Date.
|
String |
getDateString()
Gets the date string in RFC 1123 format (e.g., "Tue, 15 Nov 1994 08:12:31 GMT").
|
int |
getHour()
Gets the hour of the day (24-hour format).
|
static Date |
getInstance()
Creates a Date instance using GMT time zone.
|
static Date |
getLocalInstance()
Creates a Date instance using the local time zone.
|
int |
getMinute()
Gets the minute of the hour.
|
int |
getSecond()
Gets the second of the minute.
|
String |
getTimeString()
Gets the time string in HH:MM format with a blinking colon effect.
|
static String |
toDateString(int value)
Converts an integer value to a zero-padded string.
|
static String |
toMonthString(int value)
Converts a month value to its three-letter string representation.
|
static String |
toTimeString(int value)
Converts an integer value to a zero-padded time string.
|
static String |
toWeekString(int value)
Converts a day of week value to its three-letter string representation.
|
public Date(Calendar cal)
cal - the Calendar instance to usepublic Calendar getCalendar()
public String getDateString()
public int getHour()
public static final Date getInstance()
public static final Date getLocalInstance()
public int getMinute()
public int getSecond()
public String getTimeString()
public static final String toDateString(int value)
value - the integer value to convertpublic static final String toMonthString(int value)
value - the month value (Calendar.JANUARY to Calendar.DECEMBER)public static final String toTimeString(int value)
value - the integer value to convertpublic static final String toWeekString(int value)
value - the day of week value (Calendar.SUNDAY to Calendar.SATURDAY)