You understood well. startDate.getTime(), which calls the getTime method of the Calendar class, returns a java.util.Date object. Then the getTime method of the java.util.Date class is called, which returns a long. (I guess it would be the same to call startDate.getTimeInMillis())