Skip to content

Commit 23e2b99

Browse files
committed
Revert to default timezone if unspecified
1 parent 1dbbfc5 commit 23e2b99

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/com/hubspot/jinjava/lib/fn/Functions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ public static ZonedDateTime today(String... var) {
161161
public static String dateTimeFormat(Object var, String... format) {
162162
ZoneId zoneOffset = ZoneOffset.UTC;
163163

164-
if (format.length > 1) {
164+
if (format.length > 1 && format[1] != null) {
165165
String timezone = format[1];
166166
try {
167167
zoneOffset = ZoneId.of(timezone);
168-
} catch (DateTimeException | NullPointerException e) {
168+
} catch (DateTimeException e) {
169169
throw new InvalidArgumentException(
170170
JinjavaInterpreter.getCurrent(),
171171
"datetimeformat",

0 commit comments

Comments
 (0)