Class TMTDateTimeFormatter$


  • public class TMTDateTimeFormatter$
    extends java.lang.Object
    TMTDateTimeFormatter has a DateTimeFormatter of UTC timezone. It uses this DateTimeFormatter to format the time and parse the string presenting a time.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static TMTDateTimeFormatter$ MODULE$
      Static reference to the singleton instance of this Scala object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String format​(long time)
      Use DateTimeFormatter.ISO_INSTANT.withZone(ZoneOffset.UTC) to format the provided time
      java.time.ZonedDateTime parse​(java.lang.String dateStr)
      Use DateTimeFormatter.ISO_INSTANT.withZone(ZoneOffset.UTC) to parse the provided time
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MODULE$

        public static final TMTDateTimeFormatter$ MODULE$
        Static reference to the singleton instance of this Scala object.
    • Constructor Detail

      • TMTDateTimeFormatter$

        public TMTDateTimeFormatter$()
    • Method Detail

      • format

        public java.lang.String format​(long time)
        Use DateTimeFormatter.ISO_INSTANT.withZone(ZoneOffset.UTC) to format the provided time

        Parameters:
        time - the time needed to format and write in logs
        Returns:
        a string representation of time provided in long
      • parse

        public java.time.ZonedDateTime parse​(java.lang.String dateStr)
        Use DateTimeFormatter.ISO_INSTANT.withZone(ZoneOffset.UTC) to parse the provided time

        Parameters:
        dateStr - the time in string format that need to parse
        Returns:
        a ZonedDateTime created out of provided time