Previous Topic: absPathNext Topic: adjustResourceVals


adjustDate

The adjustDate function adjusts a date by a specified number of days, weeks, months or years.

Syntax

newDt = adjustDate(dt, number, type)

Arguments

dt (java.util.Date)

Specifies the date that needs to be adjusted.

number (Int)

Specifies the value that needs to be adjusted.

type

Specifies the type of the value to be adjusted. Can be one of the following types:

Return Value

newDt (java.util.Date)

The adjusted date is returned as a java.util.Date.

Examples

Assume that today is 2/16/2012

  1. The following example returns 2/18/2012, the date that is two days after today.
    adjustDate(today(),2,'d')
    
  2. The following example returns 2/16/2013, the date that is one year after today.
    adjustDate(today(),1'y') 
    
  3. The following example returns 2/9/2012, the date that is one week before today.
    adjustDate(today(),-1,'w')
    
  4. The following example returns 1/16/2012, the date that is one month before today.
    adjustDate(today(),-1,'m')