Class Utils


  • public class Utils
    extends Object
    This is a tool class to convert DateTime from ISO8601 to Date object.
    Author:
    Mehdi Sidhoum (Geomatys)
    • Constructor Detail

      • Utils

        public Utils()
    • 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
      • getTimeZone

        public static String getTimeZone​(String dateString)
      • 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.
      • getUnitFromDuration

        public static Unit getUnitFromDuration​(Duration duration)
        This method returns the nearest Unit of a Duration.