When we run annotations, we extract all entity mentions from the document and we consider a DATE to be an entity mention. Here is some sample code. I've add some commented out options if you just want to extract time expressions and you want that TimexAnnotations.class field to be populated.
package edu.stanford.nlp.examples;
import edu.stanford.nlp.ling.*;
import edu.stanford.nlp.util.*;
import edu.stanford.nlp.time.TimeAnnotations;
import edu.stanford.nlp.pipeline.*;
import java.util.*;
public class SUTimeExample {
public static void main(String[] args) {
Annotation document =
new Annotation("The date is 1 April 2017");
Properties props = new Properties();
//props.setProperty("customAnnotatorClass.time", "edu.stanford.nlp.time.TimeAnnotator");
//props.setProperty("annotators", "tokenize,ssplit,pos,lemma,time");
props.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner,entitymentions");
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
pipeline.annotate(document);
for (CoreMap entityMention : document.get(CoreAnnotations.MentionsAnnotation.class)) {
if (entityMention.get(CoreAnnotations.EntityTypeAnnotation.class).equals("DATE"))
System.out.println(entityMention);
}
}
}