public class StartTime
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
dateString |
private java.util.Date |
defaultTzDate |
private java.text.SimpleDateFormat |
startJobDateFormat |
Constructor and Description |
---|
StartTime(java.lang.String dateString)
Construct a
StartTime from a date given as string. |
Modifier and Type | Method and Description |
---|---|
java.util.Date |
getDate()
Returns
Date representation of StartTime as parsed using default timezone. |
java.util.Date |
getDate(java.util.TimeZone tz)
Returns
Date representation of StartTime as parsed at a given timezone. |
java.lang.String |
toString()
Returns a string representation of StartTime.
|
private final java.lang.String dateString
private final transient java.util.Date defaultTzDate
private final transient java.text.SimpleDateFormat startJobDateFormat
public StartTime(java.lang.String dateString) throws ParsingException
StartTime
from a date given as string.dateString
- the start time formatted as string to be parsedParsingException
- in case of a problem while parsing dateStringpublic java.util.Date getDate(java.util.TimeZone tz)
Date
representation of StartTime as parsed at a given timezone.
Master does not return a timezone associated with StartTime timestamp string,
therefore an explicit timezone needs to be provided for correct parsing.tz
- TimeZone associated with master.Date
representation of StartTime at provided timezonepublic java.util.Date getDate()
Date
representation of StartTime as parsed using default timezone.
NOTE: If master is using a different timezone than the default timezone of the user of this API, then the returned Date will be incorrect.
Date
representation of StartTime using default timezone.public java.lang.String toString()
toString
in class java.lang.Object