Package com.suse.salt.netapi.datatypes
Class StartTime
- java.lang.Object
-
- com.suse.salt.netapi.datatypes.StartTime
-
public class StartTime extends Object
StartDate is a convenience wrapper allowing for parsing of StartDate in the timezone appropriate to a given master.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Date
getDate()
ReturnsDate
representation of StartTime as parsed using default timezone.Date
getDate(TimeZone tz)
ReturnsDate
representation of StartTime as parsed at a given timezone.String
toString()
Returns a string representation of StartTime.
-
-
-
Constructor Detail
-
StartTime
public StartTime(String dateString) throws ParsingException
Construct aStartTime
from a date given as string.- Parameters:
dateString
- the start time formatted as string to be parsed- Throws:
ParsingException
- in case of a problem while parsing dateString
-
-
Method Detail
-
getDate
public Date getDate(TimeZone tz)
ReturnsDate
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.- Parameters:
tz
- TimeZone associated with master.- Returns:
Date
representation of StartTime at provided timezone
-
getDate
public Date getDate()
ReturnsDate
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.
- Returns:
Date
representation of StartTime using default timezone.
-
-