Here you can find the source of checkDateBetween(String time)
public static Integer checkDateBetween(String time) throws Exception
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Integer checkDateBetween(String time) throws Exception { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = sdf.parse(time); long diff = date.getTime() - new Date().getTime(); long diffHours = diff / (60 * 60 * 1000); long diffMinutes = diff / (60 * 1000) % 60; int mins = (int) (diffHours * 60 + diffMinutes); return mins; }/*from w ww . jav a2s .c om*/ }