Domino Code Fragment
Code Name* Working with Notes time | Date* 04/28/2024 | Source (or email address if you prefer)* Rlatulippe@romac.com IP address:.3.145.105.108 | |
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();
}
}
}