+ 4

How the keyword TIMESTAMP is used in MySQL?

Explain it using an example.

10th Apr 2017, 11:57 AM
Urvashi Jain
Urvashi Jain - avatar
2 Antworten
+ 2
http://stackoverflow.com/a/409305 "Timestamps in MySQL generally used to track changes to records, and are often updated every time the record is changed. If you want to store a specific value you should use a datetime field. If you meant that you want to decide between using a UNIX timestamp or a native MySQL datetime field, go with the native format. You can do calculations within MySQL that way ("SELECT DATE_ADD(my_datetime, INTERVAL 1 DAY)") and it is simple to change the format of the value to a UNIX timestamp ("SELECT UNIX_TIMESTAMP(my_datetime)") when you query the record if you want to operate on it with PHP."
16th Apr 2017, 9:52 PM
ncrypted
- 2
23rd Aug 2017, 3:43 PM
Mohit Mehta
Mohit Mehta - avatar