public class DateTimeEntity
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
java.lang.String[] |
monthOfYear
Month of the Year Default is German
|
static long |
ONE_DAY |
static int |
ONE_HOUR |
static int |
ONE_MINUTE |
static int |
ONE_SECOND |
static long |
ONE_WEEK |
static long |
ONE_YEAR |
static long |
ONE_YEAR_LY |
static java.lang.String |
W3CDTF_FORMAT |
java.lang.String[] |
weekDays
Days of the week
|
| Constructor and Description |
|---|
DateTimeEntity() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(DateField field,
int value) |
DateTimeEntity |
addTime(long value) |
void |
calculate() |
long |
get(DateField field) |
static DateTimeEntity |
getEasterSunday(int year)
Returns the date of Easter Sunday for a given year.
|
int |
getMonthLength(int month,
int year)
Returns the length of the specified month in the specified year.
|
long |
getTime() |
java.lang.Long |
getTimeWithTimeZone() |
byte |
getTimezone() |
long |
getValueInMillisecond(DateField field)
Supported Values are MILLISECOND, MILLISECONDS, MILLISECOND_OF_YEAR,
MILLISECOND_OF_DAY,MILLISECONDSREAL SECOND_OF_MINUTE, SECOND_OF_DAY,
SECOND_OF_YEAR MINUTE_OF_HOUR HOUR_OF_DAY DAY_OF_WEEK, DAY_OF_MONTH,
DAY_OF_YEAR AMPM, WEEK_OF_MONTH, WEEK_OF_YEAR YEAR
|
int |
getYearLength(int year)
Returns the length (in days) of the specified year.
|
boolean |
isDirty() |
boolean |
isLeapYear(int year)
Determines if the given year is a leap year.
|
void |
set(DateField field,
int value) |
void |
set(DateField field,
long value)
set to the date the amount value for the field
|
void |
setMidnight()
erase the time of the date
|
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String dateFormat)
format a date with the formatString
|
DateTimeEntity |
withDate(int value) |
DateTimeEntity |
withHour(int value) |
DateTimeEntity |
withMinute(int value) |
DateTimeEntity |
withMonth(int value)
set a new month for the Date
|
DateTimeEntity |
withNewDate(long date)
Set new TimeStamp
|
DateTimeEntity |
withSecond(int value) |
DateTimeEntity |
withTextItems(TextItems items) |
DateTimeEntity |
withTime(java.lang.Long value) |
DateTimeEntity |
withTimezone(java.lang.Byte value) |
DateTimeEntity |
withValue(java.util.Date date)
Setter with date
|
DateTimeEntity |
withValue(int year,
int month,
int day)
Setter with day, month and year
|
DateTimeEntity |
withValue(long milliseconds)
Setter with milliseconds
|
DateTimeEntity |
withValue(java.lang.String date)
Setter with date-String
|
DateTimeEntity |
withYear(int value)
set a new year for the date
|
public static final java.lang.String W3CDTF_FORMAT
public java.lang.String[] monthOfYear
public java.lang.String[] weekDays
public static final int ONE_SECOND
public static final int ONE_MINUTE
public static final int ONE_HOUR
public static final long ONE_DAY
public static final long ONE_WEEK
public static final long ONE_YEAR
public static final long ONE_YEAR_LY
public int getMonthLength(int month,
int year)
month - month as askingyear - year of askingisLeapYear(int)public int getYearLength(int year)
year - year for askingpublic boolean isLeapYear(int year)
true if
the given year is a leap year. To specify BC year numbers,
1 - year number must be given. For example, year BC 4 is
specified as -3.year - the given year.true if the given year is a leap year;
false otherwise.public void calculate()
public long get(DateField field)
public java.lang.Long getTimeWithTimeZone()
public DateTimeEntity withTime(java.lang.Long value)
public DateTimeEntity addTime(long value)
public byte getTimezone()
public DateTimeEntity withTimezone(java.lang.Byte value)
public boolean isDirty()
public void add(DateField field, int value)
public void set(DateField field, int value)
public void set(DateField field, long value)
field - dateTimeFieldvalue - value of changespublic DateTimeEntity withValue(long milliseconds)
milliseconds - milliseconds since 01.01.1970public DateTimeEntity withValue(int year, int month, int day)
year - year of the datemonth - month of the dateday - day of the datepublic DateTimeEntity withValue(java.lang.String date)
date - date as Stringpublic DateTimeEntity withValue(java.util.Date date)
date - with new datepublic DateTimeEntity withNewDate(long date)
date - a new Datepublic DateTimeEntity withTextItems(TextItems items)
items - The new TextItem for textpublic void setMidnight()
public static DateTimeEntity getEasterSunday(int year)
year - > 1583public java.lang.String toString(java.lang.String dateFormat)
dateFormat - The Formatpublic java.lang.String toString()
toString in class java.lang.Objectpublic DateTimeEntity withYear(int value)
value - the newYearpublic DateTimeEntity withMonth(int value)
value - The new Monthpublic DateTimeEntity withDate(int value)
public DateTimeEntity withHour(int value)
public DateTimeEntity withMinute(int value)
public DateTimeEntity withSecond(int value)
public long getTime()
public long getValueInMillisecond(DateField field)
field - The Field for get