Domino Code Fragment
Code Name* lotus.notes.DateRange class | Date* 04/28/2024 | Source (or email address if you prefer)* Rlatulippe@romac.com IP address:.18.223.159.195 | |
Description* 3. This example writes a value to the Text property, then displays the LocalTime property of the StartDateTime and EndDateTime properties (which are lotus.notes.DateTime objects). | Type* Java | Categories* (Misc) |
Implementation: | Required Client: | Server: |
Limitations: | Comments: |
public class daterange3agent extends AgentBase
{
public void NotesMain()
{
try
{
Session s = getSession();
AgentContext ac = s.getAgentContext();
Database db = ac.getCurrentDatabase();
DateTime dtdb = db.getCreated();
DateTime dtnow = s.createDateTime(null);
dtnow.setNow();
DateRange dr = s.createDateRange();
dr.setText
(dtdb.getLocalTime() + " - " +
dtnow.getLocalTime());
dr.setStartDateTime(dtdb);
dr.setEndDateTime(dtnow);
System.out.println
("Creation date - now:");
System.out.println
(dr.getStartDateTime().getLocalTime()
+ " - " +
dr.getEndDateTime().getLocalTime());
}
catch (Exception e)
{
e.printStackTrace();
}
}
}