Domino Code Fragment
Code Name* AdjustYear method | Date* 04/28/2024 | Source (or email address if you prefer)* Rlatulippe@romac.com IP address:.3.17.184.90 | |
Description* This agent decrements the date by 10 years. | Type* Java | Categories* Date/Time Handling |
Implementation: | Required Client: | Server: |
Limitations: | Comments: |
public class adjustyearagent extends AgentBase
{
public void NotesMain()
{
try
{
Session s = getSession();
DateTime dt = s.createDateTime("");
dt.setNow();
System.out.println("Today: " + dt.getLocalTime());
dt.adjustYear(-10, true);
System.out.println("Ten years ago: " + dt.getLocalTime());
}
catch (Exception e)
{
e.printStackTrace();
}
}
}