Java tutorial
//package com.java2s; //License from project: Apache License import android.support.annotation.Nullable; import java.util.Date; public class Main { public static long getTime(@Nullable Date date) { long time = -1; if (date != null) { time = date.getTime(); } return time; } }