Class UtilitiesDateFormatter

    • Constructor Detail

      • UtilitiesDateFormatter

        UtilitiesDateFormatter()
    • Method Detail

      • convertTimestampToReadableDate

         static String convertTimestampToReadableDate(long timestamp, int dateFormat, int timeFormat)

        convert timestamp to a readable date, with desired format for date and time, values accepted: DateFormat.FULL/LONG/.../SHORT.

        Parameters:
        dateFormat - value must be provided by DateFormat
        timeFormat - value must be provided by DateFormat
      • convertTimestampToReadableDate

         static String convertTimestampToReadableDate(long timestamp, int dateFormat)

        convert timestamp to a readable date, with desired format for date, values accepted: DateFormat.FULL/LONG/.../SHORT.

        Parameters:
        dateFormat - value must be provided by DateFormat
      • convertTimestampToKaijuDate

         static String convertTimestampToKaijuDate(long timestamp)

        Convert timestamps in millis to date format yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z" according to the timezone.

      • convertKaijuDateToTimestamp

        @NonNull() static long convertKaijuDateToTimestamp(String formattedDate)

        Convert date returned by Kaiju to timestamp in milliseconds. Date format of Kaiju is: 2022-02-11T11:51:08.291901Z

        Parameters:
        formattedDate - format required: yyyy-MM-dd'T'HH:mm:ss.
        Returns:

        timestamp in millis UTC if formatted has been converted with success, 0 otherwise.