Java Minute Get getMinuteCa(Date d1, Date d2)

Here you can find the source of getMinuteCa(Date d1, Date d2)

Description

get Minute Ca

License

Apache License

Declaration

public static long getMinuteCa(Date d1, Date d2) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static long getMinuteCa(Date d1, Date d2) {
        long quot = Math.abs(d1.getTime() - d2.getTime());
        quot = quot / 1000 / 60;//ww w .  jav  a2s .  c o  m
        return quot;
    }

    public static long getTime(String s) {
        return parseMysql(s).getTime();
    }

    public static Date parseMysql(String s) {
        try {
            DateFormat fmtTemp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            return fmtTemp.parse(s);
        } catch (ParseException e) {
            return null;
        }
    }
}

Related

  1. getMinute(long mills)
  2. getMinute(long time)
  3. getMinute(String time)
  4. getMinuteAfter(Date date, int minute)
  5. getMinuteAsInt(String hourString)
  6. getMinuteDate(String date, String formatFormat)
  7. getMinuteFromHMS(String hms)
  8. getMinuteFromMilliSecond(int milliSecond)
  9. getMinuteFromTime(Long timeInMilliseconds)