At 0:25 +0200 5/17/04, John Fawcett wrote:
From: "Paul DuBois"> At 22:27 +0200 5/16/04,
 John Fawcett wrote:
 >Year does not operate on a unix timestamp.

 Sure it does:

 mysql> select t, year(t) from tsdemo1;
 +----------------+---------+
 | t              | year(t) |
 +----------------+---------+
 | 20010822133241 |    2001 |
 | 20010822133241 |    2001 |
 +----------------+---------+

 The problem lies elsewhere.  Where that might be is difficult to
 say, because no PHP code has been shown yet.

The first column doesn't look like a unix timestamp.

Sorry. It's a TIMESTAMP column.

 It should be expressed
in seconds since 1970-01-01 00:00:00 GMT.

Try this to get the unix timestamp of the above date. Year shouldn't work on
it.
SELECT UNIX_TIMESTAMP('2001-08-22 13:32:41');

You're right. You'd have to apply YEAR() to FROM_UNIXTIME(UNIX_TIMESTAMP(arg)).


-- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com

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



Reply via email to