Date Time or Time Stamp?
This question already has an answer here:
I'm assuming you're talking about a database table. If that is the case and you need to know date information choose a date time for both modify_date
and create_date
. If you don't need date information use a time stamp.
Depends on your requirements. If you want to know the exact time these things happened then use a date/time (DATETIME in MySQL). Or, if you're happy with with just the date then choose date (DATE in MySQL)! If you don't know when maybe use DATETIME just to be safe (so you have the precision if you need it).
You're using MySQL so here is the documentation: http://dev.mysql.com/doc/refman/5.0/en/datetime.html
Sorry I'm from Ukraine and I use Google Translate. It all depends on how you are going to use them, if you take away from each other then TimeStamp, if just to show (for example in the news), then it is better Date Time. Generally I recommend TimeStamp
链接地址: http://www.djcxy.com/p/25108.html上一篇: 如何处理关于数据库存储的日期?
下一篇: 日期时间或时间戳?