public class DateUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
APRIL
Integer Month - April
|
static int |
AUGUST
Integer Month - August
|
static int |
DECEMBER
Integer Month - December
|
static int |
FEBRUARY
Integer Month - February
|
static int |
FRIDAY
Days of the week - Friday
|
static double |
HALFSECOND
HALF_SECOND Constant for Julian Date Construction
|
static int |
JANUARY
Integer Month - January
|
static int |
JGREG
JGREG Constant for Julian Date Construction
|
static int |
JULY
Integer Month - July
|
static int |
JUNE
Integer Month - June
|
static int |
LEFT_INCLUDE
LEFT_INCLUDE includes the start date in the Feb29 check
|
static int |
MARCH
Integer Month - March
|
static int |
MAY
Integer Month - May
|
static int |
MONDAY
Days of the week - Monday
|
static int |
NOVEMBER
Integer Month - November
|
static int |
OCTOBER
Integer Month - October
|
static int |
RIGHT_INCLUDE
RIGHT_INCLUDE includes the end date in the Feb29 check
|
static int |
SATURDAY
Days of the week - Saturday
|
static int |
SEPTEMBER
Integer Month - September
|
static int |
SUNDAY
Days of the week - Sunday
|
static int |
THURSDAY
Days of the week - Thursday
|
static int |
TUESDAY
Days of the week - Tuesday
|
static int |
WEDNESDAY
Days of the week - Wednesday
|
Constructor and Description |
---|
DateUtil() |
Modifier and Type | Method and Description |
---|---|
static char |
CodeFromMonth(int iMonth)
Retrieve the Digit Code corresponding to the Month
|
static boolean |
ContainsFeb29(int iStartDate,
int iEndDate,
int iIncludeSide)
Indicate whether there is at least One Leap Day between 2 given Dates
|
static JulianDate |
CreateFromDDMMMYYYY(java.lang.String strDate)
Create a JulianDate from a String containing the Date in the DDMMMYYYY Format
|
static JulianDate |
CreateFromMDY(java.lang.String strMDY,
java.lang.String strDelim)
Create a JulianDate from a String containing Date in the DDMMYYYY Format
|
static JulianDate |
CreateFromYMD(int iYear,
int iMonth,
int iDate)
Create a JulianDate from the Year/Month/Date
|
static JulianDate |
CreateFromYMD(java.lang.String strYMD,
java.lang.String strDelim)
Create a JulianDate from a String containing Date in the YYYYMMDD Format
|
static int |
Date(int iJulian)
Return the Date given the Julian Date represented by the Integer.
|
static int |
Day(java.util.Date dt)
Return the Day corresponding to the java.util.Date Instance
|
static java.lang.String |
DayChars(int iDay)
Get the English word for day corresponding to the input integer
|
static int |
DayOfTheWeek(java.util.Date dt)
Return the Day of the Week corresponding to the java.util.Date Instance
|
static int |
DaysElapsed(int iDate)
Number of Days elapsed in the Year represented by the given Julian Date
|
static int |
DaysInMonth(int iMonth,
int iYear)
Get the maximum number of days in the given month and year
|
static int |
DaysRemaining(int iDate)
Number of Days remaining in the Year represented by the given Julian Date
|
static java.lang.String |
DDMMMYYYY(int iJulian)
Create an DD/MMM/YYYY String from the Input Julian Integer
|
static boolean |
IsEOM(int iDate)
Indicate if the given Date corresponds to a Month End
|
static boolean |
IsLeapYear(int iDate)
Indicate if the Year of the given Julian Date is a Leap Year
|
static java.util.Date |
JavaDateFromJulianDate(JulianDate dt)
Retrieve a Java Date Instance from the Julian Date Instance
|
static JulianDate |
MakeJulianDateFromBBGDate(java.lang.String strBBGDate)
Create a JulianDate from Bloomberg date string
|
static JulianDate |
MakeJulianFromDDMMMYY(java.lang.String strDDMMMYY,
java.lang.String strDelim)
Create a JulianDate from the DD MMM YY
|
static JulianDate |
MakeJulianFromRSEntry(java.util.Date dt)
Create a JulianDate from the java Date
|
static JulianDate |
MakeJulianFromYYYYMMDD(java.lang.String strYYYYMMDD,
java.lang.String strDelim)
Create a JulianDate from the YYYY MM DD
|
static java.lang.String |
MakeOracleDateFromBBGDate(java.lang.String strBBGDate)
Create an Oracle date trigram from a Bloomberg date string
|
static java.lang.String |
MakeOracleDateFromYYYYMMDD(java.lang.String strYYYYMMDD)
Create an Oracle Date Trigram from a YYYYMMDD String
|
static int |
Month(java.util.Date dt)
Return the Month corresponding to the java.util.Date Instance.
|
static int |
Month(int iJulian)
Return the Month given the Julian Date represented by the Integer.
|
static java.lang.String |
MonthChar(int iMonth)
Return the English word corresponding to the input integer month
|
static int |
MonthFromCode(char ch)
Retrieve the Month corresponding to the Month Digit Code
|
static int |
MonthFromMonthChars(java.lang.String strMonth)
Convert the month trigram/word to the corresponding month integer
|
static java.lang.String |
MonthTrigram(int iMonth)
Return the Month Trigram corresponding to the Input Integer Month
|
static int |
NumFeb29(int iStartDate,
int iEndDate,
int iIncludeSide)
Calculate how many Leap Days exist between the 2 given Dates
|
static JulianDate |
Today()
Return a Julian Date corresponding to Today
|
static int |
ToJulian(int iYear,
int iMonth,
int iDay)
Convert YMD to an Integer Julian Date.
|
static java.lang.String |
Vintage(int iJulian)
Return the Vintage corresponding to the Julian Date
|
static int |
Year(java.util.Date dt)
Return the Year corresponding to the java.util.Date Instance
|
static int |
Year(int iJulian)
Return the Year corresponding to the Julian Date
|
static java.lang.String |
YYYYMMDD(int iJulian)
Create an YYYY/MM/DD String from the Input Julian Integer
|
public static double HALFSECOND
public static int JGREG
public static final int LEFT_INCLUDE
public static final int RIGHT_INCLUDE
public static final int MONDAY
public static final int TUESDAY
public static final int WEDNESDAY
public static final int THURSDAY
public static final int FRIDAY
public static final int SATURDAY
public static final int SUNDAY
public static final int JANUARY
public static final int FEBRUARY
public static final int MARCH
public static final int APRIL
public static final int MAY
public static final int JUNE
public static final int JULY
public static final int AUGUST
public static final int SEPTEMBER
public static final int OCTOBER
public static final int NOVEMBER
public static final int DECEMBER
public static int ToJulian(int iYear, int iMonth, int iDay) throws java.lang.Exception
iYear
- YeariMonth
- MonthiDay
- Dayjava.lang.Exception
- Thrown if the Inputs are invalidpublic static java.lang.String YYYYMMDD(int iJulian)
iJulian
- Integer representing Julian Datepublic static java.lang.String DDMMMYYYY(int iJulian)
iJulian
- Integer representing Julian Datepublic static int Year(int iJulian) throws java.lang.Exception
iJulian
- Integer representing Julian Datejava.lang.Exception
- Thrown if the Input Date in invalidpublic static int Month(int iJulian) throws java.lang.Exception
iJulian
- Integer representing Julian Datejava.lang.Exception
- Thrown if the Input Date is invalidpublic static int Date(int iJulian) throws java.lang.Exception
iJulian
- Integer representing Julian Datejava.lang.Exception
- Thrown if the Input Date is invalidpublic static java.lang.String Vintage(int iJulian)
iJulian
- Integer representing Julian Datepublic static final int DaysElapsed(int iDate) throws java.lang.Exception
iDate
- Integer representing Julian Datejava.lang.Exception
- Thrown if the Input Date is invalidpublic static final int DaysRemaining(int iDate) throws java.lang.Exception
iDate
- Integer representing Julian Datejava.lang.Exception
- Thrown if the Input Date is invalidpublic static final boolean IsLeapYear(int iDate) throws java.lang.Exception
iDate
- Input Datejava.lang.Exception
- Thrown if Input is invalidpublic static final boolean ContainsFeb29(int iStartDate, int iEndDate, int iIncludeSide) throws java.lang.Exception
iStartDate
- The Start DateiEndDate
- The End DateiIncludeSide
- INCLUDE_LEFT or INCLUDE_RIGHT indicating whether the starting date, the ending
date, or both dates are to be includedjava.lang.Exception
- If inputs are invalidpublic static final int NumFeb29(int iStartDate, int iEndDate, int iIncludeSide) throws java.lang.Exception
iStartDate
- The Start DateiEndDate
- The End DateiIncludeSide
- INCLUDE_LEFT or INCLUDE_RIGHT indicating whether the starting date, the ending
date, or both dates are to be includedjava.lang.Exception
- Thrown if the Inputs are invalidpublic static final java.lang.String MonthChar(int iMonth)
iMonth
- Integer representing the monthpublic static java.lang.String MonthTrigram(int iMonth)
iMonth
- Integer representing the Monthpublic static final int MonthFromMonthChars(java.lang.String strMonth) throws java.lang.Exception
strMonth
- Month trigram or English Wordjava.lang.Exception
- Thrown on Invalid Input Monthpublic static java.lang.String DayChars(int iDay)
iDay
- Integer representing the daypublic static final int DaysInMonth(int iMonth, int iYear) throws java.lang.Exception
iMonth
- Integer representing the monthiYear
- Integer representing the yearjava.lang.Exception
- Thrown if inputs are invalidpublic static final boolean IsEOM(int iDate) throws java.lang.Exception
iDate
- The Datejava.lang.Exception
- Thrown if input date is invalidpublic static final JulianDate CreateFromYMD(int iYear, int iMonth, int iDate)
iYear
- YeariMonth
- MonthiDate
- Datepublic static final JulianDate Today()
public static final JulianDate CreateFromDDMMMYYYY(java.lang.String strDate)
strDate
- String containing the Date in the DDMMMYYYY Formatpublic static final JulianDate CreateFromMDY(java.lang.String strMDY, java.lang.String strDelim)
strMDY
- String containing Date in the MM/DD/YYYY FormatstrDelim
- String Delimiterpublic static final JulianDate CreateFromYMD(java.lang.String strYMD, java.lang.String strDelim)
strYMD
- String containing Date in the YYYYMMDD FormatstrDelim
- String Delimiterpublic static final int DayOfTheWeek(java.util.Date dt) throws java.lang.Exception
dt
- The java.util.Date Instancejava.lang.Exception
- Thrown if Input Date is invalidpublic static final int Day(java.util.Date dt) throws java.lang.Exception
dt
- The java.util.Date Instancejava.lang.Exception
- Thrown if Inputs are Invalidpublic static final int Month(java.util.Date dt) throws java.lang.Exception
dt
- The java.util.Date Instancejava.lang.Exception
- Thrown if Inputs are Invalidpublic static final int Year(java.util.Date dt) throws java.lang.Exception
dt
- The java.util.Date Instancejava.lang.Exception
- Thrown if Inputs are Invalidpublic static java.lang.String MakeOracleDateFromYYYYMMDD(java.lang.String strYYYYMMDD)
strYYYYMMDD
- Date String in the YYYYMMDD Format.public static java.lang.String MakeOracleDateFromBBGDate(java.lang.String strBBGDate)
strBBGDate
- Bloomberg date stringpublic static final JulianDate MakeJulianFromRSEntry(java.util.Date dt)
dt
- Java Date inputpublic static final java.util.Date JavaDateFromJulianDate(JulianDate dt)
dt
- Julian Date Instancepublic static final JulianDate MakeJulianFromDDMMMYY(java.lang.String strDDMMMYY, java.lang.String strDelim)
strDDMMMYY
- Java Date input as delimited DD MMM YYstrDelim
- Delimiterpublic static final JulianDate MakeJulianFromYYYYMMDD(java.lang.String strYYYYMMDD, java.lang.String strDelim)
strYYYYMMDD
- Java Date input as delimited YYYY MM DDstrDelim
- Delimiterpublic static final JulianDate MakeJulianDateFromBBGDate(java.lang.String strBBGDate)
strBBGDate
- Bloomberg date stringpublic static final int MonthFromCode(char ch) throws java.lang.Exception
ch
- The Month Digit Codejava.lang.Exception
- Thrown if the Digit Code is Invalidpublic static final char CodeFromMonth(int iMonth) throws java.lang.Exception
iMonth
- The Monthjava.lang.Exception
- Thrown if the Digit Code cannot be computed