1
I have a record in the TIMESTAMP database and wanted to display for example:
- If the date is current, show: 'Today at 00:00'
- If it’s yesterday’s date in the bank, display 'Yesterday at 00:00'
- And if it is more than 1 day ago, display the day normally, '08/06/2017 at 00:00'
$topico_date = date('Y-m-d H:i:s');
$exibir = date('d/m/Y H:i:s', strtotime($topico_date);//Exibe: 08/06/2017 17:00:15
As the date is today I wanted it to display: Today at 5:00
Hello, could you please share 3 examples. Also the timestamp code and what should look like a "from -> to"?
– Bruno Rigolon
Usually this is done by Javascript - because PHP would process the information only once, but time keeps moving on from there.
– bfavaretto
I edited the post, look there
– William Alvares