Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Calendar;

public class Main {
    /**
     * Gets the minutes between two Calendars
     * @param startTime The start time
     * @param endTime The end time
     * @return The number of minutes between the two Calendars
     */
    public static double getMinutes(Calendar startTime, Calendar endTime) {
        if (startTime == null || endTime == null) {
            return 0;
        }
        return ((double) (endTime.getTimeInMillis() - startTime.getTimeInMillis())) / 60000;
    }
}