kouphax on 11/28/08
Last Edited at 11/28/08 04:24am
def monthsBetween(from, to){ def cfrom = new GregorianCalendar(time:from) def cto = new GregorianCalendar(time:to) return ((cto.get(Calendar.YEAR) - cfrom.get(Calendar.YEAR)) * cto.getMaximum(Calendar.MONTH)) + (cto.get(Calendar.MONTH) - cfrom.get(Calendar.MONTH)) }
Report this snippet Tweet
Comment:
You need to login to post a comment.