Domino Code Fragment
| Code Name* ConvertToZone method and ZoneTime property | Date* 06/09/2026 | Source (or email address if you prefer)* [email protected] IP address:.104.23.243.66 | |
| Description* This agent converts the current time to zone 15 time. | Type* Java | Categories* Date/Time Handling | |
| Implementation: | Required Client: | Server: |
| Limitations: | Comments: | |
public class convertozoneagent extends AgentBase
{
public void NotesMain()
{
try
{
Session s = getSession();
DateTime dt = s.createDateTime("");
dt.setNow();
System.out.println("Here and now: " + dt.getZoneTime());
dt.convertToZone(15, true);
System.out.println("Converted to zone 15: " + dt.getZoneTime());
}
catch (Exception e)
{
e.printStackTrace();
}
}
}