FreeMarker Current Date Comparison

前端 未结 4 2544

Is it possible to do date comparisons against the current date in a freemarker template without passing the current date into the template?

4条回答
  •  天命终不由人
    2021-02-20 13:25

    From FreeMarker 2.3.17 on you can use the new special variable .now:

    [#assign foo = .now > yesterday?datetime]
    

提交回复
热议问题