In several topics about date/time formatting, several users have suggested to use a number field in mysql to store the date. I normally use date/time fields. Is there any specific advantage to use number field? Also what are the drawbacks? (One I can think of is, if it is number, it has to be converted to date/time format string to display and convert date/time string to number to store).
Number or date/time field for timestamp?
the only format which would be better when used in an int field would be the unix timestamp (not the mysql one). That's also easily used with PHP so that would be an advantage. Most of the PHP time and date functions take this as an input.
All mysql supported formats should be used with the right mysql data-type. In such cases it's never a good thing to use the int data type. You'd just ignore all the date functions mysql has.
Things like NOW() and comparing dates are only possible when using the mysql date data types.
All mysql supported formats should be used with the right mysql data-type. In such cases it's never a good thing to use the int data type. You'd just ignore all the date functions mysql has.
Things like NOW() and comparing dates are only possible when using the mysql date data types.
