版权模板中的日期变量

dam*_*uar 3 intellij-idea

Intellij文档:

DateInfo has the following properties:
  year      int     The current year.
  month     int     The current month (1-12).
Run Code Online (Sandbox Code Playgroud)

我无法让Intellij为我生成当年.我尝试了所有可能的:$DateInfo.year,${DateInfo.getYear()}等等.

Faz*_*zoM 6

正如文件所说:

$ today DateInfo当前日期和时间.

...

DateInfo具有以下属性:

year int当年.

month int当前月份(1-12).

尝试: $today.year

由于这是Velocity模板(?),您不必使用大括号 - {}

干杯