Domino Code Fragment
| Code Name* lotus.notes.DateTime class | Date* 12/18/2025 | Source (or email address if you prefer)* [email protected] IP address:.172.70.100.161 | |
| Description* 2. This agent checks the result of getLocalTime against null to determine that the format of a DateTime value is invalid. | Type* Java | Categories* Date/Time Handling | |
| Implementation: | Required Client: | Server: |
| Limitations: | Comments: | |
public class datetime2agent extends AgentBase
{
public void NotesMain()
{
try
{
Session s = getSession();
DateTime dt = s.createDateTime
("bad12/12/96 04:30:00 PM");
if (dt.getLocalTime() == null) {
System.out.println("Bad format"); }
else {
System.out.println(dt.getLocalTime());
System.out.println(dt.getGMTTime()); }
}
catch (NotesException e)
{
e.printStackTrace();
}
}
}