vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, We are building an SQL table. One field in this table expresses date +time, so type TIMESTAMP seems natural for this field, but some of my colleagues would prefer type INT instead, with the semantics of UNIX time (= number of seconds since 1 Jan 1970). What would be the pros and cons of using INT instead of TIMESTAMP to express date+time? -- dave |
| ||||
| On Sun, 17 Jun 2007 23:24:11 -0700, dave_140390@hotmail.com wrote: >Hi, > >We are building an SQL table. One field in this table expresses date >+time, so type TIMESTAMP seems natural for this field, but some of my >colleagues would prefer type INT instead, with the semantics of UNIX >time (= number of seconds since 1 Jan 1970). > >What would be the pros and cons of using INT instead of TIMESTAMP to >express date+time? > >-- dave Depends what you want to do with this date. But I would use the DATETIME type. Use UNIX_TIMESTAMP(date) when you want to output it as an INT. A coffee cup is topologically equivalent to a donut, it doesn't mean you pour your coffe into your donuts. Tell this to your colleagues ! |