Domino Code Fragment
Code Name* LocalTime property | Date* 04/28/2024 | Source (or email address if you prefer)* Rlatulippe@romac.com IP address:.18.118.200.197 | |
Description* 1. This agent prints the creation date and time of the current database in local time. | Type* Java | Categories* Date/Time Handling |
Implementation: | Required Client: | Server: |
Limitations: | Comments: |
public class localtimeagent extends AgentBase
{
public void NotesMain()
{
try
{
Session s = getSession();
AgentContext ac = s.getAgentContext();
Database db = ac.getCurrentDatabase();
DateTime createdDateTime = db.getCreated();
String sCreatedDateTime = createdDateTime.getLocalTime();
System.out.println
("Database \"" + db.getTitle() +
"\" was created on " + sCreatedDateTime + ".");
}
catch (Exception e)
{
e.printStackTrace();
}
}
}