PYTHON Is there a way I can get the year difference between two dates? -


i'm developing small program insurance company see how old person (this changes ranges of cover can offer). can calculate different in years not take account days/months. there way of doing without importing things elsewhere?

thanks

as working python must use datetime module. lets have look.

from datetime import datetime  bday = '1978/11/21' dt = datetime.strptime(bday, '%y/%m/%d') diff = datetime.now() - dt diff.days 

gives 13764


Comments

Popular posts from this blog

Lists in Python -

android - can not access to progress bar in an other activity -

html - Not able to access next element of an array javascript -