How to determine start time and date of task

package scripts.task_custom_field_value;

import com.trackstudio.exception.GranException;
import com.trackstudio.external.TaskUDFValueScript;
import com.trackstudio.secured.SecuredMessageBean;
import com.trackstudio.secured.SecuredTaskBean;

import java.util.ArrayList;

/**
 * Returns the start time and date of task - time for sending the first message of type "start"

 */
public class ActualStartDate implements TaskUDFValueScript {
    public Object calculate(SecuredTaskBean task) throws GranException {

        ArrayList list = task.getMessages();
        if (list != null && !list.isEmpty()) {
            for (SecuredMessageBean message : list) {
                if (message.getMstatus().getName().equals("start")) {
                    return message.getTime();
                }
            }
        }
        return null;
    }
}