Class B2DateTimeUtil


  • public class B2DateTimeUtil
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String durationString​(long deltaSecs)  
      static java.lang.String formatFguidDateTime​(java.time.LocalDateTime dateTime)
      Returns a date-time in FGUID form: "d20150315_m092654"
      static java.lang.String formatSolidDate​(java.time.LocalDate date)
      Formats a date in "solid" format, like "20150314"
      static java.time.LocalDateTime parseDateTime​(java.lang.String str)
      Parses a date-time string in any one of these formats: "20150314092654" - "solid" Backblaze dates "d20150314_m092654" - FGUID-style Backblaze dates "2015-03-14 09:26:54" - ISO-8601 with space "2015-03-14T09:26" - ISO-8601 but no seconds "2015-03-14T09:26:54" - ISO-8601 "2015-03-14T09:26:54.547" - ISO-8601
      static java.time.Duration parseDuration​(java.lang.String str)  
      • Methods inherited from class java.lang.Object

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

      • formatSolidDate

        public static java.lang.String formatSolidDate​(java.time.LocalDate date)
        Formats a date in "solid" format, like "20150314"
      • parseDateTime

        public static java.time.LocalDateTime parseDateTime​(java.lang.String str)
        Parses a date-time string in any one of these formats: "20150314092654" - "solid" Backblaze dates "d20150314_m092654" - FGUID-style Backblaze dates "2015-03-14 09:26:54" - ISO-8601 with space "2015-03-14T09:26" - ISO-8601 but no seconds "2015-03-14T09:26:54" - ISO-8601 "2015-03-14T09:26:54.547" - ISO-8601
      • formatFguidDateTime

        public static java.lang.String formatFguidDateTime​(java.time.LocalDateTime dateTime)
        Returns a date-time in FGUID form: "d20150315_m092654"
      • parseDuration

        public static java.time.Duration parseDuration​(java.lang.String str)
        Parameters:
        str - string to parse. it must match: [-][Dd][Dh][Dm][Ds] where D is [0-9]+ and at least one of the numeric parts must be specified.
        Returns:
        the duration described by the given string or null if it doesn't match the pattern.
      • durationString

        public static java.lang.String durationString​(long deltaSecs)
        Returns:
        a succinct string describing the given number of seconds.