1
How do I return the Brazilian date in the database column so that it looks like this 29-04-2020 17:02:02
, because he’s returning like this 2020-04-29 17:02:02
.
create database teste;
use teste;
CREATE TABLE cliente (
cd_cliente INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
nome VARCHAR(30),
cpf VARCHAR(14),
telefone VARCHAR(15),
email VARCHAR(50),
cidade VARCHAR(30),
bairro VARCHAR(30),
rua VARCHAR(30),
numero INT,
data_cadastro TIMESTAMP(0)
);
insert into cliente (nome,cpf,telefone,email,cidade,bairro,rua,numero,data_cadastro)
values
('João','111.111.111-01','(77) 12345-1234','[email protected]','Guanambi','Santo Carlos','Alguma',123,CURRENT_TIMESTAMP);
select * from cliente;
Use the function
DATE_FORMAT
to obtain the date in the desired format for display.– anonimo
@anonymity where I put it
DATE_FORMAT
? Can you describe in code?– user187448