This worked well as a Simple Scripted Validator, there I didn't have to include the "import". Now I'm trying to run this elsewhere and I'm getting the error message:

What else should I include regarding dates or comparisions?
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.Issue;
def startTime = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("Start Date");
def currentDate = new Date()
if (currentDate.getHours()>=12){
currentDate.plus(2).clearTime().compareTo(startTime) <= 0
}
else {
currentDate.plus(1).clearTime().compareTo(startTime) <= 0
}