Date-related functions can be applied not only to Date type but also to DateTime type. When applied to DateTime type, a DateTime type value will be returned.
Date Add(Date date,Duration dur)
Date[] add(Date[] date,Duration dur)
A date set forward by dur will be returned. When dur is negative, a date set backward by dur will be returned.
date
Date
dur
Any duration by which the date is to be set forward (backward).
Any date set forward (backward) by the specified duration.
If the processing date/time is 2021/01/01 12:30:00, and the duration is 10 days.
Add(${processing date/time},${:duration})
→ 2021/01/11 12:30:00
Date AddYear(Date date, long year)
Date[] AddYear(Date[] date,long year)
A date value set forward by year will be returned. When year is negative, a date value set backward by year will be returned. If the year value is null, nothing is returned.
date
Date
year
Any number of years by which the date is to be set forward (backward).
Any date set forward (backward) by the specified duration.
If the processing date/time is 2021/01/01 12:30:00:
AddYear(${processing date/time},1)
→ 2022/01/01 12:30:00
Date AddMonth(Date date, long month)
Date[] AddMonth(Date[] date,long month)
A date value set forward by month will be returned. When month is negative, a date value set backward by month will be returned. If the month value is null, nothing is returned.
date
Date
month
Any number of months by which the date is to be set forward (backward).
Any date set forward (backward) by the specified duration.
If the processing date is 2021/01/01:
AddMonth(${processing date},-3)
→ 2020/10/01
Date AddWeek(Date date, long week)
Date[] AddWeek(Date[] date,long week)
A date value set forward by week will be returned. When week is negative, a date set backward by week will be returned. If the week value is null, nothing is returned.
date
Date
week
Any number of weeks by which the date is to be set forward (backward).
Any date set forward (backward) by the specified duration.
If the processing date/time is 2021/01/01 12:30:00:
AddWeek(${processing date/time},2)
→ 2021/01/15 12:30:00
Date AddDay(Date date, long day)
Date[] AddDay(Date[] date,long day)
A date value set forward by day will be returned. When day is negative, a date value set backward by day will be returned. If the day value is null, nothing is returned.
date
Date
day
Any number of days by which the date is to be set forward (backward).
Any date set forward (backward) by the specified duration.
If the processing date/time is 2021/01/01 12:30:00, and the integer value is 10.
AddDay(${processing date/time},${integer})
→ 2021/01/11 12:30:00
DateTime AddHour(DateTime date, long hour)
DateTime[] AddHour(DateTime[] date,long hour)
A date value set forward by hour will be returned. When hour is negative, a date value set backward by hour will be returned. If the hour value is null, nothing is returned.
date
Date
hour
Any number of hours by which the date is to be set forward (backward).
Any date set forward (backward) by the specified duration.
If the processing date/time is 2021/01/01 12:30:00:
AddHour(${processing date/time},12)
→ 2021/01/02 00:30:00
DateTime AddMinute(DateTime date, long minute)
DateTime[] AddMinute(DateTime[] date,long minute)
A date value set forward by minute will be returned. When minute is negative, a date value set backward by minute will be returned. If the minute value is null, nothing is returned.
date
Date
minute
Any number of minutes by which the date is to be set forward (backward).
Any date set forward (backward) by the specified duration.
If the processing date/time is 2021/01/01 12:30:00:
AddMinute(${processing date/time},-10)
→ 2021/01/01 12:20:00
DateTime MonthEnd(Date date)
DateTime[] MonthEnd(Date[] date)
Returns 23:59:59 of the last day of the month specified in the date.
date
Date
23:59:59 of the last day of the month specified in the date.
If the processing date/time is 2021/01/01 12:30:00:
MonthEnd(${processing date/time})
→ 2021/1/31 23:59:59
DateTime Now()
Returns the present date (as of the evaluation of the expression).
None
The present date (as of the evaluation of the expression).
String DateFormat(Date d,String pattern)
String DateFormat(Date d,String pattern,String timezone)
String[] DateFormat(Date[] d,String pattern)
String[] DateFormat(Date[] d,String pattern,String timezone)
Returns a date converted to the specified format. When timezone is not specified, the timezone set in the server will be applied.
d
The target date.
pattern
Any pattern string used for conversion (conforming to the pattern definition of java.text.SimpleDateFormat).
timezone
The string for any timezone (GMT+09:00) etc.
Any string converted to the specified format.
If the processing date/time is 2021/01/01 12:30:00:
DateFormat(${processing date/time},"yy/M/d H:m:s")
21/1/1 12:30:0 (year in 2 digits. Month, day, hour, minute, and second are in 1 or 2 digits with preceding zero omitted)
Duration TimeDiff(DateTime finish)
Duration[] TimeDiff(DateTime[] finish)
Duration TimeDiff(DateTime finish, DateTime start)
Duration[] TimeDiff(DateTime[] finish, DateTime start)
Returns duration between the specified finish and start dates.
If start date is omitted, the evaluation date/time is applied.
finish
Finish date
start
"Start date
Duration between the start and finish dates (in days, hours, minutes, and/or seconds)
If the date-type attribute "Planned Close Date" is 2021-08-15, and the date-type attribute "Start Date" is 2021-06-29:
TimeDiff(${Planned Close Date}, ${Start Date})
47 days