Kbase 17617: Sample code (Apptivity) - displaying todays time and date
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
Sample code (Apptivity) - displaying todays time and date
The following is the code for the action event for a button to put
todays date/time into a text field called tfDate.
You also need to include the following line to reference Calendar:
import java.util.Calendar;
public void OnActionbTimeStamp (Object arg)
{
try
{
Calendar c = Calendar.getInstance();
Timestamp javaTS = new Timestamp(c.getTime().getTime());
abTimestamp appTS = new abTimestamp(javaTS);
tfDate.setValue(appTS.getBase());
}
catch (Exception e)
{ System.out.println("set date exception :" + e); }
return
}
Progress Software Technical Support Note # 17617