Here you can find the source of diffOfMinutes(String begin, String end)
public static long diffOfMinutes(String begin, String end) throws Exception
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static long diffOfMinutes(String begin, String end) throws Exception { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date beginDate = formatter.parse(begin); Date endDate = formatter.parse(end); return (endDate.getTime() - beginDate.getTime()) / (60 * 1000); }/*w ww . j av a 2 s.c o m*/ }