Package com.hubspot.jinjava.objects.date
Class StrftimeFormatter
- java.lang.Object
-
- com.hubspot.jinjava.objects.date.StrftimeFormatter
-
public class StrftimeFormatter extends 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 StringDEFAULT_DATE_FORMAT
-
Constructor Summary
Constructors Constructor Description StrftimeFormatter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringformat(ZonedDateTime d)static Stringformat(ZonedDateTime d, String strftime)static Stringformat(ZonedDateTime d, String strftime, Locale locale)static Stringformat(ZonedDateTime d, Locale locale)static DateTimeFormattertoDateTimeFormatter(String strftime)Build aDateTimeFormatterthat matches the given Pythonstrftimepattern.
-
-
-
Field Detail
-
DEFAULT_DATE_FORMAT
public static final String DEFAULT_DATE_FORMAT
- See Also:
- Constant Field Values
-
-
Method Detail
-
toDateTimeFormatter
public static DateTimeFormatter toDateTimeFormatter(String strftime)
Build aDateTimeFormatterthat matches the given Pythonstrftimepattern.- See Also:
- Python
strftimecheatsheet
-
format
public static String format(ZonedDateTime d)
-
format
public static String format(ZonedDateTime d, Locale locale)
-
format
public static String format(ZonedDateTime d, String strftime)
-
format
public static String format(ZonedDateTime d, String strftime, Locale locale)
-
-