Date-Related

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.

Add

Format

Date Add(Date date,Duration dur)
Date[] add(Date[] date,Duration dur)

Description

A date set forward by dur will be returned. When dur is negative, a date set backward by dur will be returned.

Parameter

date

Date

dur

Any duration by which the date is to be set forward (backward).

Returned value

Any date set forward (backward) by the specified duration.

Example

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

AddYear

Format

Date AddYear(Date date, long year)
Date[] AddYear(Date[] date,long year)

Description

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.

Parameter

date

Date

year

Any number of years by which the date is to be set forward (backward).

Returned value

Any date set forward (backward) by the specified duration.

Example

If the processing date/time is 2021/01/01 12:30:00:
AddYear(${processing date/time},1)
→ 2022/01/01 12:30:00

AddMonth

Format

Date AddMonth(Date date, long month)
Date[] AddMonth(Date[] date,long month)

Description

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.

Parameter

date

Date

month

Any number of months by which the date is to be set forward (backward).

Returned value

Any date set forward (backward) by the specified duration.

Example

If the processing date is 2021/01/01:
AddMonth(${processing date},-3)
→ 2020/10/01

AddWeek

Format

Date AddWeek(Date date, long week)
Date[] AddWeek(Date[] date,long week)

Description

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.

Parameter

date

Date

week

Any number of weeks by which the date is to be set forward (backward).

Returned value

Any date set forward (backward) by the specified duration.

Example

If the processing date/time is 2021/01/01 12:30:00:
AddWeek(${processing date/time},2)
→ 2021/01/15 12:30:00

AddDay

Format

Date AddDay(Date date, long day)
Date[] AddDay(Date[] date,long day)

Description

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.

Parameter

date

Date

day

Any number of days by which the date is to be set forward (backward).

Returned value

Any date set forward (backward) by the specified duration.

Example

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

AddHour

Format

DateTime AddHour(DateTime date, long hour)
DateTime[] AddHour(DateTime[] date,long hour)

Description

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.

Parameter

date

Date

hour

Any number of hours by which the date is to be set forward (backward).

Returned value

Any date set forward (backward) by the specified duration.

Example

If the processing date/time is 2021/01/01 12:30:00:
AddHour(${processing date/time},12)
→ 2021/01/02 00:30:00

AddMinute

Format

DateTime AddMinute(DateTime date, long minute)
DateTime[] AddMinute(DateTime[] date,long minute)

Description

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.

Parameter

date

Date

minute

Any number of minutes by which the date is to be set forward (backward).

Returned value

Any date set forward (backward) by the specified duration.

Example

If the processing date/time is 2021/01/01 12:30:00:
AddMinute(${processing date/time},-10)
→ 2021/01/01 12:20:00

MonthEnd

Format

DateTime MonthEnd(Date date)
DateTime[] MonthEnd(Date[] date)

Description

Returns 23:59:59 of the last day of the month specified in the date.

Parameter

date

Date

Returned value

23:59:59 of the last day of the month specified in the date.

Example

If the processing date/time is 2021/01/01 12:30:00:
MonthEnd(${processing date/time})
→ 2021/1/31 23:59:59

Now

Format

DateTime Now()

Description

Returns the present date (as of the evaluation of the expression).

Parameter

None

Returned value

The present date (as of the evaluation of the expression).

DateFormat

Format

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)

Description

Returns a date converted to the specified format. When timezone is not specified, the timezone set in the server will be applied.

Parameter

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.

Returned value

Any string converted to the specified format.

Example

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)

TimeDiff

Format

Duration TimeDiff(DateTime finish)
Duration[] TimeDiff(DateTime[] finish)
Duration TimeDiff(DateTime finish, DateTime start)
Duration[] TimeDiff(DateTime[] finish, DateTime start)

Description

Returns duration between the specified finish and start dates.
If start date is omitted, the evaluation date/time is applied.

Parameter

finish

Finish date

start

"Start date

Returned value

Duration between the start and finish dates (in days, hours, minutes, and/or seconds)

Example

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

Go to Page Top