adspace


What is the difference between timestamp and datetime in mysql?

Answer Posted / Ruchi Deva

Both TIMESTAMP and DATETIME are used to store date and time values, but there are some differences:

1. Precision: A TIMESTAMP column can store time up to microseconds (precision up to 6), while a DATETIME column can store time up to fractional seconds (precision up to 3).
2. Default Value: If no value is specified, the default value for a TIMESTAMP column is the current date and time, while for a DATETIME column it's '0000-00-00 00:00:00'.
3. Storage Requirement: A TIMESTAMP column takes less storage space than a DATETIME column.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to Change a users password from unix shell.

1223


What is the current mysql version?

1105


Which statement is used in a select query for partial matching?

1247


What is current version of mysql?

1084