Domino Code Fragment
Code Name* ConvertToZone method and ZoneTime property | Date* 04/29/2024 | Source (or email address if you prefer)* Rlatulippe@romac.com IP address:.3.15.218.254 | |
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();
}
}
}