Domino Code Fragment
Code Name* lotus.notes.DateRange class | Date* 06/28/2025 | Source (or email address if you prefer)* [email protected] IP address:.172.70.100.18 | |
Description* 4. This example sets a value for a lotus.notes.DateRange object, then changes the lotus.notes.DateTime object that the EndDateTime property is based on. This implicitly changes the EndDateTime property. | Type* Java | Categories* (Misc) |
Implementation: | Required Client: | Server: |
Limitations: | Comments: |
public class daterange4agent extends AgentBase
{
public void NotesMain()
{
try
{
Session s = getSession();
AgentContext ac = s.getAgentContext();
Database db = ac.getCurrentDatabase();
DateTime dtdb = db.getCreated();
DateTime dtplus = s.createDateTime(null);
dtplus.setNow();
DateRange dr = s.createDateRange(dtdb, dtplus);
dtplus.adjustMonth(2);
System.out.println
("Creation date - 2 months from now:");
System.out.println
(" " + dr.getText());
}
catch (Exception e)
{
e.printStackTrace();
}
}
}