Domino Code Fragment
| Code Name* AdjustYear method | Date* 06/09/2026 | Source (or email address if you prefer)* [email protected] IP address:.104.23.197.111 | |
| 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();
}
}
}