如何在 infopath 中获取当前和明年

How to get current and next year in infopath

我有一个字段 (todaysDate),它具有以下功能:today().

我在一个字段(文本框)中显示该值,函数为:substring(todaysDate, 1, 4),它只给出年份。

我有另一个字段(文本框),我想显示下一年的值。

例如:

`todaysDate`: `2015-10-21`
`textbox`: `2015`
`textbox`: `2016`

第二个文本框必须具有以下功能:

val(substring(todaysDate, 1, 4))+1

为了获取当前年份,我添加了一个新字段:

todayYear: substring(now(), 1, 4)

为了获得明年我添加了另一个新字段:

nextYear: sum(todayYear) + 1