public int subtract ( CalendarDate start , CalendarDate end ) { long diff = end . getDifferenceInMsecs ( start ) ; int thislen = millisecs ( ) ; if ( ( diff % thislen != 0 ) ) log . warn ( "roundoff error" ) ; return ( int ) ( diff / thislen ) ; }
Subtract two dates return difference in units of this period . If not even will round down and log a warning