public class DateTime extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
COLON
Colon
|
static String |
HYPHEN
Hyphen
|
static String |
MINUS_SIGN
Minus Sign
|
static String |
PERIOD
Period
|
static String |
PLUS_SIGN
Plus Sign
|
static String |
TIME_DESIGNATOR
Time Designator
|
static String |
UTC
UTC Time Zone Designator
|
| Constructor and Description |
|---|
DateTime()
Constructor
|
DateTime(int year)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Integer |
getDay()
Get the day
|
Double |
getFraction()
Get the fraction
|
String |
getFractionText()
Get the fraction text
|
Integer |
getHour()
Get the hour
|
Integer |
getMinute()
Get the minute
|
Integer |
getMonth()
Get the month
|
Integer |
getSecond()
Get the second
|
Integer |
getTimeZoneHour()
Get the signed local time zone hour
|
Integer |
getTimeZoneMinute()
Get the local time zone minute
|
int |
getYear()
Get the year
|
boolean |
hasDay()
Check if has a day
|
boolean |
hasFraction()
Check if has a fraction
|
int |
hashCode() |
boolean |
hasHour()
Check if has a hour
|
boolean |
hasMinute()
Check if has a minute
|
boolean |
hasMonth()
Check if has a month
|
boolean |
hasSecond()
Check if has a second
|
boolean |
hasTime()
If date has a time precision
|
boolean |
hasTimeZoneHour()
Has a time zone hour
|
boolean |
hasTimeZoneMinute()
Has a time zone minute
|
boolean |
isOrdinal()
Is an ordinal day
|
boolean |
isTimeZoneUTC()
Is the time zone UTC
|
static DateTime |
parse(String text)
Parse the text into a Date Time
|
void |
setDay(Integer day)
Set the day
|
void |
setFraction(Double fraction)
Set the fraction
|
void |
setFraction(String fraction)
Set the fraction
|
void |
setHour(Integer hour)
Set the hour
|
void |
setMinute(Integer minute)
Set the minute
|
void |
setMonth(Integer month)
Set the month
|
void |
setSecond(Integer second)
Set the second
|
void |
setTimeZoneHour(Integer timeZoneHour)
Set the signed local time zone hour
|
void |
setTimeZoneMinute(Integer timeZoneMinute)
Set the local time zone minute
|
void |
setTimeZoneUTC()
Set the time zone as UTC
|
void |
setYear(int year)
Set the year
|
String |
toString() |
static DateTime |
tryParse(String text)
Attempt to parse the text into a Date Time
|
public static final String HYPHEN
public static final String TIME_DESIGNATOR
public static final String COLON
public static final String PERIOD
public static final String UTC
public static final String PLUS_SIGN
public static final String MINUS_SIGN
public DateTime()
public DateTime(int year)
year - yearpublic static DateTime parse(String text)
text - date time textpublic static DateTime tryParse(String text)
text - potential date time textpublic boolean isOrdinal()
public boolean hasTime()
public int getYear()
public void setYear(int year)
year - yearpublic Integer getMonth()
public boolean hasMonth()
public void setMonth(Integer month)
month - monthpublic Integer getDay()
public boolean hasDay()
public void setDay(Integer day)
day - daypublic Integer getHour()
public boolean hasHour()
public void setHour(Integer hour)
hour - hourpublic Integer getMinute()
public boolean hasMinute()
public void setMinute(Integer minute)
minute - minutepublic Integer getSecond()
public boolean hasSecond()
public void setSecond(Integer second)
second - secondpublic Double getFraction()
public String getFractionText()
public boolean hasFraction()
public void setFraction(Double fraction)
fraction - fractionpublic void setFraction(String fraction)
fraction - fractionpublic Integer getTimeZoneHour()
public boolean hasTimeZoneHour()
public void setTimeZoneHour(Integer timeZoneHour)
timeZoneHour - time zone hour (+ or -)public Integer getTimeZoneMinute()
public boolean hasTimeZoneMinute()
public void setTimeZoneMinute(Integer timeZoneMinute)
timeZoneMinute - time zone minutepublic boolean isTimeZoneUTC()
public void setTimeZoneUTC()
Copyright © 2021 National Geospatial-Intelligence Agency. All rights reserved.