All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mServer.tool.DateWithoutTimeComparer Maven / Gradle / Ivy

There is a newer version: 3.1.64
Show newest version
package mServer.tool;

import java.util.Calendar;

public class DateWithoutTimeComparer {
    
    private DateWithoutTimeComparer() {
    }
    
    public static int compare(Calendar c1, Calendar c2) {
        if (c1.get(Calendar.YEAR) != c2.get(Calendar.YEAR)) {
            return c1.get(Calendar.YEAR) - c2.get(Calendar.YEAR);
        }
        if (c1.get(Calendar.MONTH) != c2.get(Calendar.MONTH)) {
            return c1.get(Calendar.MONTH) - c2.get(Calendar.MONTH);
        }
        return c1.get(Calendar.DAY_OF_MONTH) - c2.get(Calendar.DAY_OF_MONTH);
    }    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy