2
I have this piece of code:
if ($informations->fundation_date != $dateFoundation) {
echo 'estou no echo diferente do date';
$alter .= 'fundation_date/';
} else {
echo 'esta igual date';
}
echo'data antiga: '.$informations->fundation_date;
echo'data nova: '.$dateFoundation;
Postgree database usage; I’m comparing whether or not the date changed in the input, but even when I do not change the date it comes different. For in the bank (fundation_date) comes as 1995-05-11 and already in the input 05/11/1995. How can I do it, but may they be the same?
When you write to the database, you have to write with the yyyy-mm-dd format. When writing to the database treat the date as a string manipulating it to look like this.
– Luís Almeida
see this: http://php.net/manual/en/datetime.format.php has to handle the date. when saving to the database save as format you want.
– Luís Almeida