from datetime import date a = date(2001,2,18) b = date(2001,2,28) print(b-a) 转载于:https://www.cnblogs.com/sea-stream/p/9993505.html