public class Date extends Object implements Comparable<Date>
Constructor and Description |
---|
Date()
Constructs a new Date object, initialized with the current date.
|
Date(Calendar cal) |
Date(DataInput in)
Creates a new instance from a RandomAccessFile.
|
Date(Date d) |
Date(int daysSince1970)
Deprecated.
|
Date(int year,
int month,
int dayOfMonth) |
Date(ObjectInputStream in)
Creates a new instance from a stream.
|
Modifier and Type | Method and Description |
---|---|
Date |
addDays(int days) |
int |
compareTo(Date otherDate) |
static Date |
createDateFromValue(long value) |
static Date |
createDDMMYYYY(String date,
String separator) |
static Date |
createYYMMDD(String date,
String separator) |
static Date |
createYYYYMMDD(String date,
String separator) |
boolean |
equals(Object obj) |
Calendar |
getCalendar() |
static Date |
getCurrentDate() |
String |
getDateString()
return the textual representation of this date with abbreviated day of week
and abbreviated month name
|
int |
getDayOfMonth() |
int |
getDayOfWeek()
get the day of the week for this date
|
int |
getDaysSince1970()
Deprecated.
|
String |
getLongDateString()
return the textual representation of this date with full day of week
and full month name (neither abbreviated)
|
int |
getMonth() |
int |
getNumberOfDaysSince(Date d) |
String |
getShortDayLongMonthString()
returns the textual representation of this date with abbreviated day of week, but full month
|
long |
getValue() |
int |
getWeekOfYear()
Returns the week number within the current year.
|
int |
getYear() |
int |
hashCode()
A hash code implementation that returns the same code for equal Dates.
|
boolean |
isFirstDayOfWeek()
is this a Monday?
|
String |
toString() |
void |
writeData(ObjectOutputStream out)
Writes this instance to a stream.
|
void |
writeToDataFile(RandomAccessFile out)
Writes this instance to a RandomAccessFile.
|
public Date()
public Date(int year, int month, int dayOfMonth)
public Date(int daysSince1970)
public Date(Calendar cal)
public Date(Date d)
public Date(DataInput in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public Date(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public int getNumberOfDaysSince(Date d)
d
- The date to check for days since.public int getYear()
public int getMonth()
public int getDayOfMonth()
public int getWeekOfYear()
public static Date getCurrentDate()
public void writeToDataFile(RandomAccessFile out) throws IOException
out
- IOException
public void writeData(ObjectOutputStream out) throws IOException
IOException
public int hashCode()
public String getDateString()
public String getLongDateString()
public String getShortDayLongMonthString()
public long getValue()
public static Date createDateFromValue(long value)
public Calendar getCalendar()
public int getDaysSince1970()
public Date addDays(int days)
public int compareTo(Date otherDate)
compareTo
in interface Comparable<Date>
public int getDayOfWeek()
public boolean isFirstDayOfWeek()
true
, if this is the first day of the weekTV-Browser 2.7.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)