0
I need to add a date column of the invoice, organized by month day and year (dd/mm/yy). How do I leave this preset time format in Mysql Workbench?
0
I need to add a date column of the invoice, organized by month day and year (dd/mm/yy). How do I leave this preset time format in Mysql Workbench?
1
If you store your dates with datetime
or date
there is no way, has to treat in select
. It’s quite simple:
SELECT data, DATE_FORMAT(data,'%d/%m/%Y') as data_formatada
FROM tabela
ORDER BY data ASC
This script should select the date the way it is ( data
), date in dd/mm/YYYY format (data_formatada
) and orders from the oldest to the newest. To reverse the ordering, change ASC
for DESC
.
Browser other questions tagged mysql
You are not signed in. Login or sign up in order to post.
You want to leave the format
dd/mm/aa
instead of the default Mysql date type at the time ofselect
?– vinibrsl
That’s right, that’s right
– Caio Bento