What field do I use to store a timestamp in mysql?

0

I need to store a timestamp with php, but I do not know what would be the best mysql field to use.

    
asked by anonymous 01.06.2018 / 06:21

2 answers

0

Depends what you need to store, if it's just the date you can use the DATE type, if it's just the TIME time and if it's both, use DATETIME. Just select which one the column will receive.

    
01.06.2018 / 06:32
2

MySQL has a TIMESTAMP type, which is just the UNIX TIMESTAMP, as mentioned here . Another option is to use INT, since it is an integer as well.

    
01.06.2018 / 07:15