View Full Version : Why is user.joindate a 'int' field?
telc
Fri 27th Sep '02, 6:50pm
I am trying to format the sql but I can't because joindate, is a 'int' field
mysql> select DATE_FORMAT(joindate, '%m.%d.%Y') AS joindate from user limit 0,1;
+----------+
| joindate |
+----------+
| NULL |
Why would the unix timestamp be stored in a 'int' field?
filburt1
Sat 28th Sep '02, 1:21pm
I for one have always wondered why stuff isn't stored in the database as TIMESTAMP(14) which has conversion functions built into MySQL...
Freddie Bingham
Sat 28th Sep '02, 1:24pm
Using INT is more portable for other database types.
telc
Sat 28th Sep '02, 1:27pm
Do you know anyway to format it using Mysql since its in an 'int' field? I want to write a query they gives my the average # of new users a day. I wanted to be able to select it in the format MM-DD-YYYY then group by it.
MattR
Sat 28th Sep '02, 7:09pm
DATETIME is a standard datatype, but unfortunately MySQL stores it in a non-standard way. :(
vBulletin® v3.8.0 Beta 3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.