diff --git a/core/Global.js b/core/Global.js index 7b0b2fdf..18dcd43a 100644 --- a/core/Global.js +++ b/core/Global.js @@ -52,7 +52,11 @@ function write_macro(param, text) { function now_macro(param) { var d = new Date(); if (param.format) { - res.write(d.format(param.format)); + try { + res.write(d.format(param.format)); + } catch (e) { + res.write('[Invalid date format]'); + } } else if (param.as == "timestamp") { res.write(d.getTime()); } else {