2
I’m trying to get a date of this next select in python
select MAX(PAYMENT_DATE) from fact_cashflow
WHERE DOCUMENT_ID = 'SALDO FINAL' and PAYMENT_AMOUNT > 0
But my answer on the console is this
(datetime.date(2017, 2, 1),)
I would like the date to be formatted in '2017-02-01'
How do I do?
This is the correct way: convert the date at the time of submission to the user in Python. In the accepted answer, what comes from the database is a string, and all the advantages of Python datetime objects are lost: comparisons, distance to other dates, can be used again on another object, etc...
– jsbueno