I have two variables (defined as datetime)
latest_month and invoice_month
I intend to compare these two in a if loop, one data set of them is:
latest_month: 08/01/2019 00:00:00
invoice_month: 10/01/2018 00:00:00
But the result seems not really got compared in a numerical sense.
My if condition looks like this:
latest_month < invoice_month
Anybody could kindly help me out to enlighten me abit:
- Should I further convert them into a MMM yyyy format for an easy comparison
- Why my existing logic not working?