On 2 Dec 2003 at 7:57, Ron McKeever wrote:

> I have a db that gets data dumped into it. One of the columns gets
> unix timestamp data "utime". I what to covert that into a datetime
> column so I can utlize indexes and such. But I still what the unixtime
> to remain.

You can use indexes with a Unix time column about as well as you can 
with DATETIME.  What sort of queries are you wanting to do?  Having 
the extra column may be unnecessary.

> I believe I have a good way to do this but I'm not sure why it's not
> converting the date right ( see at bottom ):

It seems to be converting the date right.  FROM_UNIXTIME() does the
opposite of UNIX_TIMESTAMP().  It takes an integer representing a
Unix time and converts it to a DATETIME in local time (not GMT).  It
would be nice if there were a FROM_UNIXTIME_TO_GMT() function, but
there isn't.

-- 
Keith C. Ivey <[EMAIL PROTECTED]>
Tobacco Documents Online
http://tobaccodocuments.org


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to