[thelist] SQL DB-Agnostic Date Storage

gabriel rivera evolt at protocol0.com
Wed Feb 5 22:32:14 CST 2003


True...mysql has FROM_UNIXTIME(), but I think the conversion would be a
roll-your-own function for most any other engine.

But DATETIME is universal...little did I know.  Definitely the best
approach!

-Gabriel

> the problem with this is that you cannot then use sql like
>
>  select month(datefield), count(*), sum(amount)
>       from yourtable
>     group by  month(datefield)
>
> unless the database's standard date functions like month() also work on
> those integers




More information about the thelist mailing list