Class ISODateTimeUtil


  • @Scriptable
    public final class ISODateTimeUtil
    extends Object
    The static methods of this class are thread-safe.
    • Field Detail

      • UTC_ISO_DATE_TIME_FORMAT

        public static final String UTC_ISO_DATE_TIME_FORMAT
        The standard ISO UTC format yyyy-MM-dd'T'HH:mm:ss'Z'.
        See Also:
        Constant Field Values
      • UTC_ISO_DATE_TIME_FORMAT_MILLIS

        public static final String UTC_ISO_DATE_TIME_FORMAT_MILLIS
        The standard ISO UTC format with milliseconds yyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        @Deprecated
        public static ISODateTimeUtil.Instance newInstance()
        Deprecated.
        The static methods of this class are thread-safe so there is no need to create an instance of this utility.
        Create an instance of the ISO date time utility.
        Returns:
        A new instance of the utility.
      • formatISODateTime

        public static String formatISODateTime​(Date p_dt)
        Format the given date in the standard UTC ISO format (yyyy-MM-dd'T'HH:mm:ss'Z').
        Parameters:
        p_dt - The date to be formatted.
        Returns:
        The formatted date.
      • formatISODateTimeMillis

        public static String formatISODateTimeMillis​(Date p_dt)
        Format the given date in the standard UTC ISO format, with milliseconds (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
        Parameters:
        p_dt - The date to be formatted.
        Returns:
        The formatted date.
      • parseISODateTime

        public static Date parseISODateTime​(String p_str)
        Parse the given date in the standard UTC ISO format (yyyy-MM-dd'T'HH:mm:ss'Z').
        Parameters:
        p_str - The date to be parsed, e.g. 2013-12-24T17:00:00Z.
        Returns:
        The parsed date.
      • parseISODateTimeMillis

        public static Date parseISODateTimeMillis​(String p_str)
        Parse the given date in the standard UTC ISO format, with milliseconds (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
        Parameters:
        p_str - The date to be parsed, e.g. 2013-12-24T17:00:00.123Z.
        Returns:
        The parsed date.
      • parseISODateTimeOptionalMillis

        public static Date parseISODateTimeOptionalMillis​(String p_str)
        Parse the given date in the standard UTC ISO format, with optional milliseconds (either yyyy-MM-dd'T'HH:mm:ss'Z', or yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
        Parameters:
        p_str - The date to be parsed, e.g. 2013-12-24T17:00:00.123Z.
        Returns:
        The parsed date.