FORMULA LANGUAGE


@Adjust
Example

Adjusts the specified time-date value by the number of years, months, days, hours, minutes, and/or seconds you specify. The amount of adjustment may be positive or negative.

Syntax

@Adjust( dateToAdjust ; years ; months ; days ; hours ; minutes ; seconds ; [DST] )

Parameters

dateToAdjust


years
months
days
hours
minutes
seconds
[DST]
Return value

adjustedDate


Usage

If the first parameter is a list, the function operates on each element of the list, and the return value is a list with the same number of elements.

You must include all arguments except the [DST] keyword; include a zero (0) for parameters you don't want to adjust.

The arguments are applied from right to left. For instance, @Adjust([2/2/2006]; 0; 2; 28; 0; 0; 0) returns [5/2/2006], not [4/30/2006] as you might expect. This is because @Adjust first adds 28 days, making [3/2/2006], then adds two months, making [5/2/2006]. To first add two months, then add 28 days, use @Adjust twice, for instance: @Adjust(@Adjust([02/02/2006]; 0; 2; 0; 0; 0; 0); 0; 0; 28; 0; 0; 0)

Tip To find the difference between two dates, subtract them. The result is returned in seconds. To adjust the result to days, divide the result by 86,400 - which is the number of seconds in a day. For example, if you have two date fields, date1, which contains [07/01/01] and date2, which contains [07/05/01], use the following formula to return the number of days between the two dates:


Calculating due dates

A typical use for @Adjust is calculating a due date from an entry date, by adjusting only one component of the time-date value, for example, the month component.

Language cross-reference

AdjustYear method in LotusScript NotesDateTime class

adjustYear method in Java DateTime class

AdjustMonth method in LotusScript NotesDateTime class

adjustMonth method in Java DateTime class

AdjustDay method in LotusScript NotesDateTime class

adjustDay method in Java DateTime class

AdjustHour method in LotusScript NotesDateTime class

adjustHour method in Java DateTime class

AdjustMinute method in LotusScript NotesDateTime class

adjustMinute method in Java DateTime class

AdjustSecond method in LotusScript NotesDateTime class

adjustSecond method in Java DateTime class

Example
See Also