Package com.softwaremining.util
Class CBLDate
java.lang.Object
com.softwaremining.util.CBLDate
- Direct Known Subclasses:
CenturyDate
,CurrentDate
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionreturn date in format: yyyyMMddreturn date in format: yyyyMMddHHmmSS.nano.final int
getDay()
Returns the Day-of-Monthstatic int
COBOL reprsentation of day-of-week.static String
static int
static String
get Day of year (1-366)final String
returns day of month as a stringreturns format : yyMMddint
getMonth()
COBOL version of month - January is month 1
(in Java Month starts from 0)COBOL version of month - January is month 1
(in Java Month starts from 0)long
getTime()
String representing the date with century E.g.int
getYear()
static String
for translation of COBOL ACCEPT x5 FROM DAY The first 2 character is the Year (00-99) The remaining 5 character is Day-of-year.static String
returns the last 2 digit of current yearreturns the last 2 digit of current yearvoid
setDay
(int day) Set Day-Of-Monthint
integer representing the date E.g.toString()
String representing the date E.g.
-
Field Details
-
localDateTime
-
-
Constructor Details
-
CBLDate
public CBLDate() -
CBLDate
-
CBLDate
public CBLDate(long millis) -
CBLDate
-
CBLDate
-
-
Method Details
-
getDay
public final int getDay()Returns the Day-of-Month -
getDayString
returns day of month as a string -
getMonth
public int getMonth()COBOL version of month - January is month 1
(in Java Month starts from 0)- Returns:
-
getMonthString
COBOL version of month - January is month 1
(in Java Month starts from 0)- Returns:
- Stringified month
-
getYear
public int getYear() -
getYearString
returns the last 2 digit of current year- Returns:
-
setDay
public void setDay(int day) Set Day-Of-Month- Parameters:
day
-
-
getDayOfWeek
public static int getDayOfWeek()COBOL reprsentation of day-of-week. 1 is Monday ... 7 is Sunday.- Returns:
-
getDayOfWeekString
-
getYearAndDayOfYear
for translation of COBOL ACCEPT x5 FROM DAY The first 2 character is the Year (00-99) The remaining 5 character is Day-of-year. (1,366)- Returns:
-
getYearOfCentury
returns the last 2 digit of current year- Returns:
-
getDayOfYear
public static int getDayOfYear() -
getDayOfYearString
get Day of year (1-366)- Returns:
-
getFormatted
returns format : yyMMdd- Returns:
-
getCenturyFormatted
return date in format: yyyyMMdd- Returns:
-
getCurrentDateFormatted
return date in format: yyyyMMddHHmmSS.nano.- Returns:
-
getFormattedCenturyFormatted
-
getUSFormattedDate
String representing the date with century E.g. for 2010-01-29 it will "100129" -
getTime
public long getTime() -
toString
String representing the date E.g. for 2010-12-29 it will return "122910" -
toInteger
public int toInteger()integer representing the date E.g. for 2010-01-29 it will return 100129
-