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 String
DEFAULT_DATE_FORMAT
-
Constructor Summary
Constructors Constructor Description StrftimeFormatter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
format(ZonedDateTime d)
static String
format(ZonedDateTime d, String strftime)
static String
format(ZonedDateTime d, String strftime, Locale locale)
static String
format(ZonedDateTime d, Locale locale)
static DateTimeFormatter
toDateTimeFormatter(String strftime)
Build aDateTimeFormatter
that matches the given Pythonstrftime
pattern.
-
-
-
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 aDateTimeFormatter
that matches the given Pythonstrftime
pattern.- See Also:
- Python
strftime
cheatsheet
-
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)
-
-