How to insert timestamp value into a MySQL table?

-1

I'm getting a timestamp value from a request, and I'd like to store this value in my database, however I want the column to interpret it correctly.

The value is 1416178487. And using PHP's date('d/m/y',1416178487); function, it returns the date: 11/16/2014.

I would like to know if there is a setting for the table to receive the value like so: 1416178487 and show it like this: 11/16/2014.

    
asked by anonymous 17.11.2014 / 00:06

1 answer

2

You can select a column that contains a timestamp in MySQL as a date in that format by doing the following query:

SELECT FROM_UNIXTIME(coluna_timestamp, '%d/%m/%Y')
FROM minha_tabela;
    
17.11.2014 / 01:09