Re: UNIX timestamp with microseconds

2005-11-16 Thread Gleb Paharenko
Hello. According to the manual Unix timestamp (seconds since '1970-01-01 00:00:00', so, in my opinion UNIX_TIMESTAMP is not designed for obtaining microseconds. Have a look here, if you haven't done this yet: http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html Ryan

Re: unix timestamp

2005-08-15 Thread SGreen
Sebastian [EMAIL PROTECTED] wrote on 08/15/2005 03:51:05 PM: i have this query: SELECT COUNT(*) AS score FROM downloads WHERE date_add(dateline, interval 1 hour) = now() GROUP BY filename ORDER BY score DESC unfortunately for other reasons i had to change `dateline` to unix timestamp so

Re: unix timestamp

2005-08-15 Thread Chris
Well, you could use the FROM_UNIXTIME() function to convert it into a datetime MySQL understands. SELECT COUNT(*) AS score FROM downloads WHERE date_add(FROM_UNIXTIME(dateline), interval 1 hour) = now() GROUP BY filename ORDER BY score DESC But, considering what you're doing, it would

Re: unix timestamp

2005-08-15 Thread Scott Gifford
Sebastian [EMAIL PROTECTED] writes: i have this query: SELECT COUNT(*) AS score FROM downloads WHERE date_add(dateline, interval 1 hour) = now() GROUP BY filename ORDER BY score DESC unfortunately for other reasons i had to change `dateline` to unix timestamp so this query is no longer

Re: unix timestamp

2005-08-15 Thread Keith Ivey
Scott Gifford wrote: SELECT COUNT(*) AS score FROM downloads WHERE dateline + 3600 = UNIX_TIMESTAMP() GROUP BY filename ORDER BY score DESC It would be better with WHERE dateline = UNIX_TIMESTAMP() - 3600 so that it can use an index on dateline. -- Keith Ivey [EMAIL

Re: unix timestamp

2005-08-15 Thread Scott Gifford
Keith Ivey [EMAIL PROTECTED] writes: Scott Gifford wrote: SELECT COUNT(*) AS score FROM downloads WHERE dateline + 3600 = UNIX_TIMESTAMP() GROUP BY filename ORDER BY score DESC It would be better with WHERE dateline = UNIX_TIMESTAMP() - 3600 so that it can use an index

Re: unix timestamp

2005-08-15 Thread Bastian Balthazar Bux
Sebastian wrote: i have this query: SELECT COUNT(*) AS score FROM downloads WHERE date_add(dateline, interval 1 hour) = now() GROUP BY filename ORDER BY score DESC unfortunately for other reasons i had to change `dateline` to unix timestamp so this query is no longer able to run as

RE: Unix-Timestamp() in myODBC 02.50

2001-12-16 Thread Bart Goormans
(answer to myself anyone interested ;0) After setting my date to Unix_Timestamp mode, I convert it to a 10-base number: - CONV(UNIX_TIMESTAMP(U.lastTime),10,10) - Then, I perform the substraction: