I have this query:
$sql = "SELECT * FROM giorni WHERE punto = '$punto' && STR_TO_DATE(giorno, '%d/%m/%Y') ...
I need to do a similar query for the previous year. How can i do %Y-1
?
I have this query:
$sql = "SELECT * FROM giorni WHERE punto = '$punto' && STR_TO_DATE(giorno, '%d/%m/%Y') ...
I need to do a similar query for the previous year. How can i do %Y-1
?
Copyright © 2021 Jogjafile Inc.
You can simply subtract 1 year from the converted date: