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