[UPHPU] Why do forums use Int(11) for dates?
bigdog at venticon.com
Thu Apr 6 23:06:36 MDT 2006
Brandon Stout wrote:
> I'm migrating users from my main website to a new one more specific to
> their needs. I use phpwebsite for mscis.org, but these users - people
> from my high school graduating class - just need a forum. I've tried
> phpbb2 and Simple Machines (per earlier uphpu discussions). I dumped
> the user names via phpmyadmin fine, but phpbb2 and Simple Machines both
> use an int(11) field for the CreateDate. If it were a date field, I
> could just put in 20060406 for all of them, but I don't know how to read
> Int(11) dates... My 2 questions:
> 1. Why do people use Int(11) instead of Date fields?
> 2. What is today in Int(11) date format?
personally, i think this is bad db design as you are putting a date value in a
integer data type. timestamps are okay to use and you can store them in a
timestamp data type that will do the job fine. Unless there is some other
pressing design here like really watching the amount of space that each data
type is using then i would recommend using the proper data type for it. this
will also all you to use the database's built in date functions on that field.
or instead of having php format the date you could do it in the database.
More information about the UPHPU