
import datetime from dateutil.relativedelta import relativedelta a = '2014-05-06 12:00:56' b = '2013-03-06 16:08:22' start = datetime.datetime.strptime(a, '%Y-%m-%d %H:%M:%S') ends = datetime.datetime.strptime(b, '%Y-%m-%d %H:%M:%S') diff = relativedelta(start, ends) >>> print "The difference is %d year %d month %d days %d hours %d minutes" % (diff.years, diff.months, diff.days, diff.hours, diff.minutes) The difference is 1 year 1 month 29 days 19 hours 52 minutes
If you have been searching for the right note-taking or knowledge management app, you have…
Looking for AnyType alternatives? You're not alone. AnyType has gained popularity as a privacy-focused, local-first…
Notion is a popular all-in-one workspace, but many users seek alternatives for different needs (free…
Logseq is a beloved tool in the personal knowledge management (PKM) community. It's free, open-source,…
Looking for a Webshare alternative? You're not alone. Webshare is a popular proxy service with…
Docker changed software development forever. It made containers accessible, gave developers a simple workflow, and…