Package org.geotools.temporal.object
Class Utils
- Object
-
- Utils
-
public class Utils extends Object
This is a tool class to convert DateTime from ISO8601 to Date object.- Author:
- Mehdi Sidhoum (Geomatys)
-
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Date
calendarDateToDate(CalendarDate calDate)
Convert a CalendarDate object to java.util.Date.static Date
dateAndTimeToDate(DateAndTime dateAndTime)
Convert a DateAndTime object to Date.static Date
getDateFromString(String dateString)
Returns a Date object from an ISO-8601 representation string.static long
getTimeInMillis(String periodDuration)
Return a Date (long time) from a String descriptionstatic String
getTimeZone(String dateString)
static Unit
getUnitFromDuration(Duration duration)
This method returns the nearest Unit of a Duration.static Date
JulianToDate(JulianDate jdt)
Convert a JulianDate to Datestatic Date
ordinalToDate(OrdinalPosition ordinalPosition)
static Date
temporalCoordToDate(TemporalCoordinate temporalCoord)
Convert a TemporalCoordinate object to Date.
-
-
-
Method Detail
-
getDateFromString
public static Date getDateFromString(String dateString) throws ParseException
Returns a Date object from an ISO-8601 representation string. (String defined with pattern yyyy-MM-dd'T'HH:mm:ss.SSSZ or yyyy-MM-dd).- Throws:
ParseException
-
getTimeInMillis
public static long getTimeInMillis(String periodDuration)
Return a Date (long time) from a String description
-
JulianToDate
public static Date JulianToDate(JulianDate jdt)
Convert a JulianDate to Date
-
calendarDateToDate
public static Date calendarDateToDate(CalendarDate calDate)
Convert a CalendarDate object to java.util.Date.
-
dateAndTimeToDate
public static Date dateAndTimeToDate(DateAndTime dateAndTime)
Convert a DateAndTime object to Date.
-
temporalCoordToDate
public static Date temporalCoordToDate(TemporalCoordinate temporalCoord)
Convert a TemporalCoordinate object to Date.
-
ordinalToDate
public static Date ordinalToDate(OrdinalPosition ordinalPosition)
-
getUnitFromDuration
public static Unit getUnitFromDuration(Duration duration)
This method returns the nearest Unit of a Duration.
-
-