Jul-24-2018, 11:03 AM
import datetime ... date_diff = datetime.datetime.now() - test_date ...I was writing similar answer but was ninjad by buran :-). Very good answer and I like it.
Observation / nitpicking: it is matter of preference but one option is to use
datetime.datetime.today()
which is for me personally more in line with 'explicit is better than implicit'. I am not speaking english natively so for me 'today' is associated with date and 'now' with time. However, it is a matter of expected behaviour of code rather than personal biases.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.