Class StrftimeFormatter


  • public class StrftimeFormatter
    extends java.lang.Object
    Datetime format string formatter, supporting both python and java compatible format strings by converting any percent-tokens from python into their java equivalents.
    Author:
    jstehler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_DATE_FORMAT  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String format​(java.time.ZonedDateTime d)  
      static java.lang.String format​(java.time.ZonedDateTime d, java.lang.String strftime)  
      static java.lang.String format​(java.time.ZonedDateTime d, java.lang.String strftime, java.util.Locale locale)  
      static java.lang.String format​(java.time.ZonedDateTime d, java.util.Locale locale)  
      static java.time.format.DateTimeFormatter toDateTimeFormatter​(java.lang.String strftime)
      Build a DateTimeFormatter that matches the given Python strftime pattern.
      • Methods inherited from class java.lang.Object

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

      • DEFAULT_DATE_FORMAT

        public static final java.lang.String DEFAULT_DATE_FORMAT
        See Also:
        Constant Field Values
    • Constructor Detail

      • StrftimeFormatter

        public StrftimeFormatter()
    • Method Detail

      • toDateTimeFormatter

        public static java.time.format.DateTimeFormatter toDateTimeFormatter​(java.lang.String strftime)
        Build a DateTimeFormatter that matches the given Python strftime pattern.
        See Also:
        Python strftime cheatsheet
      • format

        public static java.lang.String format​(java.time.ZonedDateTime d)
      • format

        public static java.lang.String format​(java.time.ZonedDateTime d,
                                              java.util.Locale locale)
      • format

        public static java.lang.String format​(java.time.ZonedDateTime d,
                                              java.lang.String strftime)
      • format

        public static java.lang.String format​(java.time.ZonedDateTime d,
                                              java.lang.String strftime,
                                              java.util.Locale locale)