
/**
 * This class holds a time value consisting of hours, minutes, and seconds.
 */
public class Timestamp
{
    // data fields
    public int hrs;
    public int mins;
    public int secs;
    public java.lang.String am_pm;

    /**
     * This method updates the hours, minutes, and seconds values
     * associated with the Timestamp object.
     */
    public void fillTimes()
    {
        java.util.Calendar now;
        now = java.util.Calendar.getInstance();
        hrs = now.get(java.util.Calendar.HOUR);
        hrs = hrs == 0 ? 12 : hrs;
        mins = now.get(java.util.Calendar.MINUTE);
        secs = now.get(java.util.Calendar.SECOND);
        am_pm = now.get(java.util.Calendar.AM_PM) == java.util.Calendar.AM
            ? "AM"
            : "PM";
    }
}

