Package mil.nga.crs.common
Class DateTime
- java.lang.Object
- 
- mil.nga.crs.common.DateTime
 
- 
 public class DateTime extends Object Date and time- Author:
- osbornb
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)IntegergetDay()Get the dayDoublegetFraction()Get the fractionStringgetFractionText()Get the fraction textIntegergetHour()Get the hourIntegergetMinute()Get the minuteIntegergetMonth()Get the monthIntegergetSecond()Get the secondIntegergetTimeZoneHour()Get the signed local time zone hourIntegergetTimeZoneMinute()Get the local time zone minuteintgetYear()Get the yearbooleanhasDay()Check if has a daybooleanhasFraction()Check if has a fractioninthashCode()booleanhasHour()Check if has a hourbooleanhasMinute()Check if has a minutebooleanhasMonth()Check if has a monthbooleanhasSecond()Check if has a secondbooleanhasTime()If date has a time precisionbooleanhasTimeZoneHour()Has a time zone hourbooleanhasTimeZoneMinute()Has a time zone minutebooleanisOrdinal()Is an ordinal daybooleanisTimeZoneUTC()Is the time zone UTCstatic DateTimeparse(String text)Parse the text into a Date TimevoidsetDay(Integer day)Set the dayvoidsetFraction(Double fraction)Set the fractionvoidsetFraction(String fraction)Set the fractionvoidsetHour(Integer hour)Set the hourvoidsetMinute(Integer minute)Set the minutevoidsetMonth(Integer month)Set the monthvoidsetSecond(Integer second)Set the secondvoidsetTimeZoneHour(Integer timeZoneHour)Set the signed local time zone hourvoidsetTimeZoneMinute(Integer timeZoneMinute)Set the local time zone minutevoidsetTimeZoneUTC()Set the time zone as UTCvoidsetYear(int year)Set the yearStringtoString()static DateTimetryParse(String text)Attempt to parse the text into a Date Time
 
- 
- 
- 
Field Detail- 
HYPHENpublic static final String HYPHEN Hyphen- See Also:
- Constant Field Values
 
 - 
TIME_DESIGNATORpublic static final String TIME_DESIGNATOR Time Designator- See Also:
- Constant Field Values
 
 - 
COLONpublic static final String COLON Colon- See Also:
- Constant Field Values
 
 - 
PERIODpublic static final String PERIOD Period- See Also:
- Constant Field Values
 
 - 
UTCpublic static final String UTC UTC Time Zone Designator- See Also:
- Constant Field Values
 
 - 
PLUS_SIGNpublic static final String PLUS_SIGN Plus Sign- See Also:
- Constant Field Values
 
 - 
MINUS_SIGNpublic static final String MINUS_SIGN Minus Sign- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
parsepublic static DateTime parse(String text) Parse the text into a Date Time- Parameters:
- text- date time text
- Returns:
- date time
 
 - 
tryParsepublic static DateTime tryParse(String text) Attempt to parse the text into a Date Time- Parameters:
- text- potential date time text
- Returns:
- date time or null
 
 - 
isOrdinalpublic boolean isOrdinal() Is an ordinal day- Returns:
- true if ordinal day
 
 - 
hasTimepublic boolean hasTime() If date has a time precision- Returns:
- true if has time
 
 - 
getYearpublic int getYear() Get the year- Returns:
- year
 
 - 
setYearpublic void setYear(int year) Set the year- Parameters:
- year- year
 
 - 
getMonthpublic Integer getMonth() Get the month- Returns:
- month
 
 - 
hasMonthpublic boolean hasMonth() Check if has a month- Returns:
- true if has month
 
 - 
setMonthpublic void setMonth(Integer month) Set the month- Parameters:
- month- month
 
 - 
getDaypublic Integer getDay() Get the day- Returns:
- day
 
 - 
hasDaypublic boolean hasDay() Check if has a day- Returns:
- true if has day
 
 - 
setDaypublic void setDay(Integer day) Set the day- Parameters:
- day- day
 
 - 
getHourpublic Integer getHour() Get the hour- Returns:
- hour
 
 - 
hasHourpublic boolean hasHour() Check if has a hour- Returns:
- true if has hour
 
 - 
setHourpublic void setHour(Integer hour) Set the hour- Parameters:
- hour- hour
 
 - 
getMinutepublic Integer getMinute() Get the minute- Returns:
- minute
 
 - 
hasMinutepublic boolean hasMinute() Check if has a minute- Returns:
- true if has minute
 
 - 
setMinutepublic void setMinute(Integer minute) Set the minute- Parameters:
- minute- minute
 
 - 
getSecondpublic Integer getSecond() Get the second- Returns:
- second
 
 - 
hasSecondpublic boolean hasSecond() Check if has a second- Returns:
- true if has second
 
 - 
setSecondpublic void setSecond(Integer second) Set the second- Parameters:
- second- second
 
 - 
getFractionpublic Double getFraction() Get the fraction- Returns:
- fraction
 
 - 
getFractionTextpublic String getFractionText() Get the fraction text- Returns:
- fraction text
- Since:
- 1.1.0
 
 - 
hasFractionpublic boolean hasFraction() Check if has a fraction- Returns:
- true if has fraction
 
 - 
setFractionpublic void setFraction(Double fraction) Set the fraction- Parameters:
- fraction- fraction
 
 - 
setFractionpublic void setFraction(String fraction) Set the fraction- Parameters:
- fraction- fraction
- Since:
- 1.1.0
 
 - 
getTimeZoneHourpublic Integer getTimeZoneHour() Get the signed local time zone hour- Returns:
- time zone hour (+ or -)
 
 - 
hasTimeZoneHourpublic boolean hasTimeZoneHour() Has a time zone hour- Returns:
- true if has time zone hour
 
 - 
setTimeZoneHourpublic void setTimeZoneHour(Integer timeZoneHour) Set the signed local time zone hour- Parameters:
- timeZoneHour- time zone hour (+ or -)
 
 - 
getTimeZoneMinutepublic Integer getTimeZoneMinute() Get the local time zone minute- Returns:
- time zone minute
 
 - 
hasTimeZoneMinutepublic boolean hasTimeZoneMinute() Has a time zone minute- Returns:
- true if has time zone minute
 
 - 
setTimeZoneMinutepublic void setTimeZoneMinute(Integer timeZoneMinute) Set the local time zone minute- Parameters:
- timeZoneMinute- time zone minute
 
 - 
isTimeZoneUTCpublic boolean isTimeZoneUTC() Is the time zone UTC- Returns:
- true if UTC
 
 - 
setTimeZoneUTCpublic void setTimeZoneUTC() Set the time zone as UTC
 
- 
 
-