|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindprod.common11.BigDate
public final class BigDate
Manipulate pure dates, without time or time zone.
Convert Gregorian YYYY MM DD back and forth to ordinal days since 1970-01-01, Thursday (sometimes called Julian or datestamp form). BigDate objects are not designed for storing dates in a database, just for conversion. Long term storage should store the ordinal either as an int, or possibly as a short. The BigDate constructor stores the date both in ordinal and Gregorian forms internally. If you store one, it creates the other. The standard Sun Date won't handle dates prior to 1970 among other problems. BigDate handles dates 999,999 BC Jan 1 to 999,999 AD Dec 31, 0 = 1970-01-01. Are the following quirks of the calendar considered in this code? 1900 is not a leap year (mod 100): yes. 2000 is a leap year (mod 400): yes. The 10 missing days in 1582 October.: yes (Pope Gregory's correction) 1582-10-05 to 1582-10-14 never happened. Britain and its territories (including the USA and Canada) adopted the Gregorian correction in 1752: Yes. By then, 11 days had to be dropped. 1752-09-03 to 1752-09-13 never happened. However, you can modify constants in BigDate to use the British calendar. Such a change only affects dates prior to 1753 since BigDate calendar is based on 1970-01-01. toOrdinal with the Gregorian and British scheme will give the same number for recent dates. You must recompile BigDate with the isBritish boolean changed to true.. It was used by Britain and its colonies which later became the USA and Canada. However Nova Scotia used Pope Gregory's calendar. see http://mindprod.com/jgloss/missingdays.html PLEASE CONFIGURE isBritish AND RECOMPILE BigDate IF YOU WISH TO USE THE BRITISH CALENDAR. missing year 0 between 1 BC and 1 AD. yes. in Roman times leap years occurred at irregular intervals, Considered inauspicious, they were avoided during war. no. Instead we presume leap years every 4 years even back to 999,999BC. leap seconds: no Normally all you need is one BigDate object that you use for all interconversions with set(ordinal), set(yyy,mm,dd) and getOrdinal(), getYYYY(), getMM(), getDD(). java.util.Date has some odd habits, using 101 to represent the year 2001, and 11 to represent December. BigDate is more conventional. You use 2001 to represent the year 2001 and 12 to represent December. BigDate implements proleptic Gregorian and Julian calendars. That is, dates are computed by extrapolating the current rules indefinitely far backward and forward in time. As a result, BigDate may be used for all years to generate meaningful and consistent results. However, dates obtained using BigDate are historically accurate only from March 1, 4 AD onward, when modern Julian calendar rules were adopted. Before this date, leap year rules were applied irregularly, and before 45 BC the Julian calendar did not even exist. Prior to the institution of the Gregorian calendar, New Year's Day was March 25. To avoid confusion, this calendar always uses January 1. TODO Future enhancements: - handle time, and time zones, interconversion with GregorianCalendar dates.
Field Summary | |
---|---|
static int |
APR
April is 4 |
static int |
APRIL
April is 4 |
static int |
AUG
August is 8 |
static int |
AUGUST
August is 8 |
static int |
BYPASSCHECK
Constant: when passed to a constructor, it means caller guarantees YYYY MM DD are valid including leap year effects and missing day effects. |
static int |
CHECK
constant: when passed to a contructor it means BigDate should check that YYYY MM DD are valid. |
protected int |
dd
Day, 1 to 31. |
static int |
DEC
December is 12 |
static int |
DECEMBER
December is 12 |
static int |
FEB
February is 2 |
static int |
FEBRUARY
February is |
static int |
FRI
Friday in BigDate is 5 |
static int |
FRIDAY
Friday in BigDate is 5 |
static boolean |
isBritish
PLEASE CONFIGURE isBritish BEFORE COMPILING. |
static int |
JAN
January is 1 |
static int |
JANUARY
January is 1 |
static int |
JUL
July is 7 |
static int |
JULY
July is 7 |
static int |
JUN
June is 6 |
static int |
JUNE
June is 6 |
static int |
MAR
March is 3 |
static int |
MARCH
March is 3 |
static int |
MAX_ORDINAL
Constant: biggest ordinal that BigDate will accept, corresponds to 999,999 Dec 31 AD. |
static int |
MAX_YEAR
Constant: biggest year that BigDate handles, 999,999 AD. |
static int |
MAY
May is 5 |
static int |
MIN_ORDINAL
Constant: earliest ordinal that BigDate handles; corresponds to 999,999 Jan 01 BC. |
static int |
MIN_YEAR
Constant: earliest year that BigDate handles, 999,999 BC. |
protected int |
mm
Month, 1 to 12. |
static int |
MON
Monday in BigDate is 1 |
static int |
MONDAY
Monday in BigDate is 1 |
static int |
NORMALISE
Constant: when passed to a constructor, it means any invalid dates are converted into the equivalent valid ones. |
static int |
NORMALIZE
Constant: American spelling alias for NORMALISE. |
static int |
NOV
November is 11 |
static int |
NOVEMBER
November is 11 |
static int |
NULL_ORDINAL
Constant: ordinal to represent a null date -2,147,483,648, null Gregorian is 0,0,0. |
static long |
NULL_TIMESTAMP
Constant : value for a null TimeStamp -9,223,372,036,854,775,808 |
static int |
OCT
October is 10 |
static int |
OCTOBER
October is 10 |
protected int |
ordinal
Ordinal days since Jan 01, 1970. |
static int |
SAT
Saturday in BigDate is 6 |
static int |
SATURDAY
Saturday in BigDate is 6 |
static int |
SEP
September is 9 |
static int |
SEPTEMBER
September is 9 |
(package private) static long |
serialVersionUID
used to identify this version of serialised BigDate objects |
static int |
SUN
Sunday is 0 |
static int |
SUNDAY
Sunday is 0 |
static int |
THU
Thursday in BigDate is 4 |
static int |
THURSDAY
Thursday in BigDate is 4 |
static int |
TUE
Tuesday in BigDate is 2 |
static int |
TUESDAY
Tuesday in BigDate is 2 |
static int |
WED
Wednesday in BigDate is 3 |
static int |
WEDNESDAY
Wednesday in BigDate is 3 |
protected int |
yyyy
Year, -999,999 to +999,999, negative is BC, positive is AD, 0 is null. |
Constructor Summary | |
---|---|
BigDate()
Constructor for the null date. |
|
BigDate(BigDate b)
Copy constructor |
|
BigDate(java.util.Date utc,
java.util.TimeZone timeZone)
Constructor from Date, loses time information. |
|
BigDate(double prolepticJulianDay)
Construct a BigDate object given the Proleptic Julian day number. |
|
BigDate(int ordinal)
Ordinal constructor. |
|
BigDate(int yyyy,
int mm,
int dd)
Construct a BigDate object given a Gregorian date yyyy, mm, dd; always rejects invalid dates. |
|
BigDate(int yyyy,
int mm,
int dd,
int how)
Construct a BigDate object given a Gregorian date yyyy, mm, dd; allows control of how invalid dates are handled. |
|
BigDate(java.lang.String yyyy_mm_dd)
Create a BigDate object from a String of the form: yyyy-mm-dd must have 4-digit years, and use dashes between the number and no sign Does extensive checks considering leap years, missing days etc. |
Method Summary | |
---|---|
void |
addDays(int days)
increment this date by a number of days. |
static int[] |
age(BigDate birthDate,
BigDate asOf)
calculate the age in years, months and days. |
protected void |
calcOrdinal()
Convert date in form YYYY MM DD into days since the epoch, leaving results internally. |
int |
calendarDayOfWeek()
Get day of week for this BigDate. |
static int |
calendarDayOfWeek(int ordinal)
Get day of week for given ordinal. |
java.lang.Object |
clone()
standard clone. |
static int |
compare(int yyyy1,
int mm1,
int dd1,
int yyyy2,
int mm2,
int dd2)
Compare two dates in yyyy mm dd form. |
int |
compareTo(java.lang.Object other)
Compare BigDates in ascending date order. |
static java.lang.String |
dayAbbr(int dayOfWeek)
Get 3-char abbreviation of a given day of the week |
static java.lang.String |
dayName(int dayOfWeek)
Get full name of given day of the week |
int |
dayOfWeek()
Get day of week for this BigDate. |
static int |
dayOfWeek(int ordinal)
Get day of week for given ordinal. |
static int |
daysInMonth(int mm,
boolean leap)
How many days are there in a given month? |
static int |
daysInMonth(int mm,
int yyyy)
How many days are there in a given month? |
protected static int |
daysInYearPriorToMonth(int mm,
boolean leap)
How many days were there in the year prior to the first day of the given month? |
protected static int |
dddToMM(int ddd,
boolean leap)
Convert day number ddd in year to month. |
boolean |
equals(java.lang.Object d)
Compares with another BigDate to see if they refer to the same date. |
static int |
flooredMulDiv(int multiplicand,
int multiplier,
int divisor)
Multiply then divide using floored rather than the usual truncated arithmetic, using a long intermediate. |
int |
getCalendarDayOfWeek()
Get day of week for this BigDate. |
static java.lang.String |
getCopyright()
Embeds copyright notice |
java.util.Date |
getDate(java.util.TimeZone timeZone)
Get java.util.Date object corresponding to this BigDate, |
int |
getDayOfWeek()
Get day of week for this BigDate. |
int |
getDD()
get day of month for this BigDate. |
int |
getDDD()
Get day number in the year for this BigDate. |
int |
getISODayOfWeek()
Get day of week 1 to 7 for this BigDate according to the ISO standard IS-8601. |
int |
getISOWeekNumber()
Get week number 1 to 53 of the year this date falls in, according to the rules of ISO standard IS-8601. |
java.util.Date |
getLocalDate()
Get java.util.Date object corresponding to this BigDate. |
long |
getLocalTimeStamp()
Get milliseconds since 1970-01-01 00:00 GMT for this BigDate. |
int |
getMM()
Get month of year for this BigDate. |
int |
getOrdinal()
get days since 1970-01-01 for this BigDate. |
double |
getProlepticJulianDay()
|
int |
getSeason()
Get season of year for this BigDate. |
long |
getTimeStamp(java.util.TimeZone timeZone)
Get milliseconds since 1970-01-01 00:00 GMT for this BigDate, as at the start of day 0:00. |
java.util.Date |
getUTCDate()
Get java.util.Date object corresponding to this BigDate. |
long |
getUTCTimeStamp()
Get milliseconds since 1970-01-01 00:00 GMT for this BigDate. |
int |
getWeekNumber()
Get week number 1 to 53 of the year this date falls in. |
int |
getYYYY()
Get year for this BigDate. |
int |
hashCode()
hashCode for use in Hashtable/HashMap lookup |
static boolean |
isAnniversary(BigDate birthDate,
BigDate asOf)
Determine if this date is someone's birthdate, or the aniversary of their death, or the anniversary of a marriage etc. |
static boolean |
isLeap(int yyyy)
Is the given year a leap year, considering history, mod 100 and mod 400 rules? By 1582, this excess of leap years had built up noticeably. |
static int |
isoDayOfWeek(int ordinal)
Get day of week 1 to 7 for this ordinal according to the ISO standard IS-8601. |
static boolean |
isValid(int yyyy,
int mm,
int dd)
Test to see if the given yyyy, mm, dd date is legitimate. |
static boolean |
isValid(java.lang.String yyyy_mm_dd)
Test to see if the given yyyy-mm-dd is a date as a String is legitimate. |
protected static int |
jan01OfYear(int yyyy)
Ordinal date of Jan 01 of the given year. |
static BigDate |
localToday()
Returns a BigDate object initialised to today's local date. |
static java.lang.String |
monthAbbr(int mm)
Get 3-char abbreviation of a given month of the year. |
static java.lang.String |
monthName(int mm)
Get full name of a given month of the year. |
BigDate |
nearestXXXDay(int dayOfWeek)
Find the BigDate with date closest to this one with the given day of week. |
protected void |
normalise()
Clean up an invalid date, leaving the results internally e.g. |
static int |
nthXXXDay(int which,
int dayOfWeek,
int yyyy,
int mm)
Find the first monday in a given month, the 3rd monday or the last Thursday... |
int |
ordinal()
get days since 1970-01-01 for this BigDate. |
static int |
ordinalOfnthXXXDay(int which,
int dayOfWeek,
int yyyy,
int mm)
Find the first monday in a given month, the 3rd monday or the last Thursday... |
static int |
parseYYYY(java.lang.String yyyyString)
parse a string into yyyy which may have form: 1948 230BC 1234AD It does not allow a space before the BC or AD. |
static BigDate |
parseYYYYmmdd(java.lang.String incomplete)
Parse a, possibly incomplete, date String of form yyyy-yy-dd or yyyy-mm or yyyy into a BigDate Also handles AD/BC, 1-digit months, 1-digit days and 1, 2 or 3-digit years. |
void |
set(int ordinal)
Set the ordinal field, and compute the equivalent internal Gregorian yyyy mm dd fields. |
void |
set(int yyyy,
int mm,
int dd)
Set the yyyy mm dd Gregorian fields, and compute the internal ordinal equivalent. |
void |
set(int yyyy,
int mm,
int dd,
int how)
Set the Gregorian fields, and compute the ordinal equivalent with the same modifiers CHECK, NORMALIZE, BYPASSCHECK as the constructor. |
void |
setDateAtTime(long utcTimestamp,
java.util.TimeZone timeZone)
Sets the date that corresponding to a given utc timestamp at a given TimeZone. |
void |
setOrdinal(int ordinal)
Set the ordinal field, and compute the equivalent internal Gregorian yyyy mm dd fields. |
static BigDate |
today(java.util.TimeZone timeZone)
Returns a BigDate object initialised to the date right now in the given TimeZone. |
java.lang.String |
toDowMMDDYY()
Convert date to a human-readable String [wed mm/dd/yy] |
protected void |
toGregorian()
converts ordinal to YYYY MM DD, leaving results internally. |
static int |
toOrdinal(int yyyy,
int mm,
int dd)
Convert date in form YYYY MM DD into days since the 1970-01-01. |
static int |
toOrdinal(java.lang.String yyyy_mm_dd)
Convert ISO date string in form YYYY-MM-DD into days since the 1970-01-01. |
java.lang.String |
toString()
Convert date to a human-readable String. |
java.lang.String |
toYYYYString()
Convert just year part of date to a human-readable String. |
static BigDate |
UTCToday()
Returns a BigDate object initialised to today's UTC (Greenwich GMT) date, in other words the date and time in Greenwich England right now without any summer time correction. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final boolean isBritish
public static final int APR
public static final int APRIL
public static final int AUG
public static final int AUGUST
public static final int BYPASSCHECK
CHECK
,
NORMALIZE
,
NORMALISE
,
Constant Field Valuespublic static final int CHECK
BYPASSCHECK
,
NORMALIZE
,
NORMALISE
,
Constant Field Valuespublic static final int DEC
public static final int DECEMBER
public static final int FEB
public static final int FEBRUARY
public static final int FRI
public static final int FRIDAY
public static final int JAN
public static final int JANUARY
public static final int JUL
public static final int JULY
public static final int JUN
public static final int JUNE
public static final int MAR
public static final int MARCH
public static final int MAX_ORDINAL
public static final int MAX_YEAR
public static final int MAY
public static final int MIN_ORDINAL
public static final int MIN_YEAR
public static final int MON
public static final int MONDAY
public static final int NORMALISE
CHECK
,
BYPASSCHECK
,
NORMALIZE
,
Constant Field Valuespublic static final int NORMALIZE
CHECK
,
BYPASSCHECK
,
NORMALISE
public static final int NOV
public static final int NOVEMBER
public static final int NULL_ORDINAL
public static final int OCT
public static final int OCTOBER
public static final int SAT
public static final int SATURDAY
public static final int SEP
public static final int SEPTEMBER
public static final int SUN
public static final int SUNDAY
public static final int THU
public static final int THURSDAY
public static final int TUE
public static final int TUESDAY
public static final int WED
public static final int WEDNESDAY
public static final long NULL_TIMESTAMP
static final long serialVersionUID
protected transient int dd
protected transient int mm
protected int ordinal
protected transient int yyyy
Constructor Detail |
---|
public BigDate()
localToday()
,
UTCToday()
,
today(java.util.TimeZone)
public BigDate(double prolepticJulianDay)
prolepticJulianDay
- days since 4713 BC Jan 1 noon. Such numbers usually arise in astronomical calculation.
You don't need to concern yourself with the strangeness of the Julian calendar, just
its simple day numbering. BEWARE! after adjusting for noon, fractional parts are
discarded. BigDate tracks only dates, not dates and times. e.g. 2000-03-20 noon is
2,451,624 in proleptic day numbers. 1970-01-01 is 2,440,588 1600-1-1 is 2,305,448
1500-1-1 is 2,268,933 0001-1-1 is 1,721,424 -0001-12-31 is 1,721,423 -0006-1-1 is
1,719,232 -4713-1-1 is 0public BigDate(int ordinal)
ordinal
- days since 1970-01-01.public BigDate(java.lang.String yyyy_mm_dd)
yyyy_mm_dd
- string of form "yyyy-mm-dd".
yyyy-mm-dd
y-mm-ddBC
2009-12-31
1234-5-31AD
1970/3/3 AD
3.01.12 bc
2000_12_31
It will not accept a date missing the year, month or day field. Spaces and commas are ignored.public BigDate(BigDate b)
b
- an existing BigDate object to use as a model for cloning another.public BigDate(java.util.Date utc, java.util.TimeZone timeZone)
utc
- Date ( UTC date/time stamp )timeZone
- Which timeZone do you want to know the date for that UTC time. e.g. TimeZone.getDefault(), new
TimeZone("GMT")public BigDate(int yyyy, int mm, int dd)
yyyy
- -999,999 (BC) to +999,999 (AD)mm
- month 1 to 12 (not 0 to 11 as in Sun's Date), no lead 0.dd
- day 1 to 31, no lead 0.
java.lang.NumberFormatException
- for invalid yyyy mm ddpublic BigDate(int yyyy, int mm, int dd, int how)
yyyy
- -999,999 (BC) to +999,999 (AD)mm
- month 1 to 12 (not 0 to 11 as in Sun's Date), no lead 0.dd
- day 1 to 31, no lead 0.how
- one of CHECK BYPASSCHECK NORMALIZE NORMALISEMethod Detail |
---|
public static BigDate UTCToday()
localToday()
,
today(java.util.TimeZone)
public static int[] age(BigDate birthDate, BigDate asOf)
birthDate
- usually the birth of a person.asOf
- usually today, the day you want the age as of. asOf must come after birthDate to get a
meaningful result. Usually asOf > birthDate.
Difference is always positive no matter if asOf is > or < birthDate
localToday()
,
today(java.util.TimeZone)
,
UTCToday()
,
isAnniversary(com.mindprod.common11.BigDate, com.mindprod.common11.BigDate)
public static int calendarDayOfWeek(int ordinal)
ordinal
- days since 1970-01-01 to test.
isoDayOfWeek(int)
,
dayOfWeek(int)
,
getCalendarDayOfWeek()
public static final int compare(int yyyy1, int mm1, int dd1, int yyyy2, int mm2, int dd2)
yyyy1
- first yearmm1
- first month 1..12dd1
- first day 1..31yyyy2
- second yearmm2
- second month 1..12dd2
- second day 1..31
compareTo(Object)
public static java.lang.String dayAbbr(int dayOfWeek)
dayOfWeek
- sunday = 0
public static java.lang.String dayName(int dayOfWeek)
dayOfWeek
- sunday = 0
public java.lang.Object clone()
clone
in class java.lang.Object
public static int dayOfWeek(int ordinal)
ordinal
- days since 1970-01-01 to test.
calendarDayOfWeek(int)
,
isoDayOfWeek(int)
,
getDayOfWeek()
public static int daysInMonth(int mm, boolean leap)
mm
- month 1 to 12 (not 0 to 11 as in Sun's Date), no lead 0.leap
- true if you are interested in a leap year
public static int daysInMonth(int mm, int yyyy)
mm
- month 1 to 12 (not 0 to 11 as in Sun's Date), no lead 0, or you will get octal.yyyy
- year of interest.
public static int flooredMulDiv(int multiplicand, int multiplier, int divisor)
multiplicand
- one of two numbers to multiply togethermultiplier
- one of two numbers to multiply togetherdivisor
- number to divide by
public static java.lang.String getCopyright()
public static boolean isAnniversary(BigDate birthDate, BigDate asOf)
birthDate
- usually the birth of a person, or possibly a date.asOf
- usually today, the day you want the to know if it is an anniversary. asof must come after birthDate to get a
meaningful result.
age(com.mindprod.common11.BigDate, com.mindprod.common11.BigDate)
public static boolean isLeap(int yyyy)
yyyy
- year to test.
public static boolean isValid(java.lang.String yyyy_mm_dd)
yyyy_mm_dd
- string of form "yyyy-mm-dd".
yyyy-mm-dd
y-mm-ddBC
2009-12-31
1234-5-31AD
1970/3/3 AD
3.01.12 bc
2000_12_31
It will not accept a date missing the year, month or day field. Spaces and commas are ignored.
public static boolean isValid(int yyyy, int mm, int dd)
yyyy
- -999,999 (BC) to +999,999 (AD)mm
- month 1 to 12 (not 0 to 11 as in Sun's Date), no lead 0.dd
- day 1 to 31, no lead 0.
public static int isoDayOfWeek(int ordinal)
ordinal
- days since 1970-01-01 to test.
dayOfWeek(int)
public static BigDate localToday()
today(java.util.TimeZone)
,
UTCToday()
public static java.lang.String monthAbbr(int mm)
mm
- month number jan = 1
public static java.lang.String monthName(int mm)
mm
- month number jan = 1
public static int nthXXXDay(int which, int dayOfWeek, int yyyy, int mm)
which
- 1=first 2=second 3=third 4=fourth 5=last (might be 4th or 5th)dayOfWeek
- 0=Sunday 1=Monday 2=Tuesday 3=Wednesday 4=Thursday 5=Friday 6=Saturday WARNING: not compatible
with 1=Calendar.SUNDAY.yyyy
- year of interest.mm
- month 1 to 12 (not 0 to 11 as in Sun's Date), no lead 0.
public static int ordinalOfnthXXXDay(int which, int dayOfWeek, int yyyy, int mm)
which
- 1=first 2=second 3=third 4=fourth 5=last (might be 4th or 5th)dayOfWeek
- 0=Sunday 1=Monday 2=Tuesday 3=Wednesday 4=Thursday 5=Friday 6=Saturday WARNING: not compatible
with 1=Calendar.SUNDAY.yyyy
- year of interest.mm
- month 1 to 12 (not 0 to 11 as in Sun's Date), no lead 0.
public static int parseYYYY(java.lang.String yyyyString) throws java.lang.NumberFormatException
yyyyString
- date string.
java.lang.NumberFormatException
- id the string has non-numeric chars.public static BigDate parseYYYYmmdd(java.lang.String incomplete)
incomplete
- Date string, usually of form YYYY-MM-DD, possibly just YYYY-MM or YYYY.
BigDate(String)
public static int toOrdinal(java.lang.String yyyy_mm_dd)
yyyy_mm_dd
- iso date string.
public static int toOrdinal(int yyyy, int mm, int dd)
yyyy
- -999,999 (BC) to +999,999 (AD)mm
- month 1 to 12 (not 0 to 11 as in Sun's Date), no lead 0.dd
- day 1 to 31, no lead 0.
public static BigDate today(java.util.TimeZone timeZone)
timeZone
- in which we want to know the today's date.
localToday()
,
UTCToday()
public final void addDays(int days)
days
- positive or negative, -1 gets day before this one.public int calendarDayOfWeek()
isoDayOfWeek(int)
,
dayOfWeek(int)
,
getCalendarDayOfWeek()
public final int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
other
- other BigDate to compare with this one
compare(int, int, int, int, int, int)
public int dayOfWeek()
calendarDayOfWeek(int)
,
isoDayOfWeek(int)
,
getDayOfWeek()
public final boolean equals(java.lang.Object d)
equals
in class java.lang.Object
d
- other BigDate to compare with this one.
public final int getCalendarDayOfWeek()
getISODayOfWeek()
,
getDayOfWeek()
,
calendarDayOfWeek(int)
public final int getDD()
public final int getDDD()
public final java.util.Date getDate(java.util.TimeZone timeZone)
timeZone
- We consider this BigDate to have an implied time of 0:00 in this timeZone.
getLocalTimeStamp()
,
getUTCTimeStamp()
,
getTimeStamp(java.util.TimeZone)
,
getUTCDate()
,
getLocalDate()
public final int getDayOfWeek()
getCalendarDayOfWeek()
,
getISODayOfWeek()
,
dayOfWeek(int)
public final int getISODayOfWeek()
getCalendarDayOfWeek()
,
getDayOfWeek()
,
isoDayOfWeek(int)
public final int getISOWeekNumber()
public final java.util.Date getLocalDate()
getLocalTimeStamp()
public final long getLocalTimeStamp()
getLocalDate()
public final int getMM()
public final int getOrdinal()
getLocalTimeStamp()
,
getUTCTimeStamp()
,
getTimeStamp(java.util.TimeZone)
public final double getProlepticJulianDay()
public final int getSeason()
public final long getTimeStamp(java.util.TimeZone timeZone)
timeZone
- We consider this BigDate to have an implied time of 0:00 in this timeZone.
getDate(java.util.TimeZone)
,
getUTCTimeStamp()
,
getLocalTimeStamp()
public final java.util.Date getUTCDate()
getUTCTimeStamp()
public final long getUTCTimeStamp()
getUTCDate()
public final int getWeekNumber()
getISOWeekNumber()
public final int getYYYY()
public final int hashCode()
hashCode
in class java.lang.Object
public BigDate nearestXXXDay(int dayOfWeek)
dayOfWeek
- 0=Sunday 1=Monday 2=Tuesday 3=Wednesday 4=Thursday 5=Friday 6=Saturday WARNING: not compatible
with 1=Calendar.SUNDAY.
public final int ordinal()
getLocalTimeStamp()
,
getUTCTimeStamp()
,
getTimeStamp(java.util.TimeZone)
public final void set(int ordinal)
ordinal
- days since 1970-01-01.public final void set(int yyyy, int mm, int dd)
yyyy
- -999,999 (BC) to +999,999 (AD)mm
- month 1 to 12 (not 0 to 11 as in Sun's Date), no lead 0.dd
- day 1 to 31, no lead 0.public final void set(int yyyy, int mm, int dd, int how)
yyyy
- -999,999 (BC) to +999,999 (AD)mm
- month 1 to 12 (not 0 to 11 as in Sun's Date), no lead 0.dd
- day 1 to 31, no lead 0.how
- one of CHECK BYPASSCHECK NORMALIZE NORMALISE
the following are constants, not enums.CHECK
,
BYPASSCHECK
,
NORMALIZE
,
NORMALISE
public void setDateAtTime(long utcTimestamp, java.util.TimeZone timeZone)
utcTimestamp
- milliseconds since 1970 in UTC time. E.g. Date.getTimetimeZone
- Timezone you want to know the date in at that time. TimeZone.getDefault() TimeZone.getUpublic final void setOrdinal(int ordinal)
ordinal
- days since 1970-01-01.public java.lang.String toDowMMDDYY()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toYYYYString()
protected static int daysInYearPriorToMonth(int mm, boolean leap)
mm
- month 1 to 12 (not 0 to 11 as in Sun's Date), no lead 0.leap
- true if you are interested in a leap year.
protected static int dddToMM(int ddd, boolean leap)
ddd
- day number in year Jan 01 = 1, 1 to 366.leap
- true if year of interest is boolean.
protected static int jan01OfYear(int yyyy)
yyyy
- year of interest
protected final void calcOrdinal()
getOrdinal()
protected final void normalise()
protected final void toGregorian()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |