2014-04-07から1日間の記事一覧
def diff_month(d1, d2): """ get months between two dates. >>> from datetime import date >>> diff_month(date(2012, 12, 1), date(2013, 3, 1)) 3 """ if d1 > d2: d1, d2 = d2, d1 return (d2.year - d1.year)*12 + d2.month - d1.month datetime - Be…