Domino Code Fragment
| Code Name* Working with Notes time | Date* 12/19/2025 | Source (or email address if you prefer)* [email protected] IP address:.172.70.80.30 | |
| Description* 1. This agent gets the creation date of the current database into a DateTime object, prints the date-time in local time and GMT time, converts the time to zone 15 time, and prints the zone 15 time. | Type* Java | Categories* Date/Time Handling | |
| Implementation: | Required Client: | Server: |
| Limitations: | Comments: | |
public class working1agent extends AgentBase
{
public void NotesMain()
{
try
{
Session s = getSession();
AgentContext ac = s.getAgentContext();
Database db = ac.getCurrentDatabase();
DateTime dt = db.getCreated();
System.out.println
("Creation date of current database");
System.out.println
(" Local time: " + dt.getLocalTime());
System.out.println
(" GMT time: " + dt.getGMTTime());
boolean dst = dt.isDST();
dt.convertToZone(15, dst);
System.out.println
(" Time in zone 15: " + dt.getZoneTime());
}
catch (Exception e)
{
e.printStackTrace();
}
}
}