Domino Code Fragment

Code Name*
DateOnly property
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.220.137.164
Description*
This agent prints the creation date of the current database.
Type*
Java
Categories*
Date/Time Handling
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
import lotus.notes.*;


public class dateonlyagent extends AgentBase
{
 public void NotesMain()
 {
   try
   {
     Session s = getSession();
     AgentContext ac = s.getAgentContext();
     Database db = ac.getCurrentDatabase();
     DateTime createdDateTime = db.getCreated();
     String sCreatedDateTime = createdDateTime.getDateOnly();
     System.out.println
     ("Database \"" + db.getTitle() +
     "\" was created on " + sCreatedDateTime + ".");
   }
   catch (Exception e)
   {
     e.printStackTrace();
   }
 }
}