I can format the date using strftime in python, but now I want to display the date in a format relative to the current time.
i.e. if the date is close to today, show on time.
if it is within a week, it is displayed as yesterday, etc.
if it is displayed during the month only last week or in the month.
if it is older than shown as the actual value.
I can do this with more ifs, but is there an easier way to do this? or libraries?
source share