If you run the select "SELECT NOW() + 10000*RAND();" a few times, you'll
see that not all values are valid timestamps, e.g.:

mysql> SELECT NOW() + 10000*RAND();
+----------------------+
| NOW() + 10000*RAND() |
+----------------------+
|       20050713112881 |
+----------------------+
1 row in set (0.00 sec)

If you're trying to add seconds onto a timestamp, you're probably
looking for something like:

SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(NOW()) + 10000*RAND());

> -----Original Message-----
> From: Antonio Gulli [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, July 13, 2005 8:31 AM
> To: mysql@lists.mysql.com
> Subject: Timestamp problem.
> 
> I have the following part in a schema
> 
> describe feeds
> .........
> ........
> | pubdate     | timestamp    | YES  |     | CURRENT_TIMESTAMP 
> |       |
> 
> show create table feeds;
> 
>  `pubdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update 
> CURRENT_TIMESTAMP,
> 
> when i make an
> 
> INSERT INTO feeds(...., pubdate) VALUES (....,NOW()+10000*RAND())
> 
> is there any chance to have:
> 
> mysql> select count(*) from feeds where pubdate = 0;
> +----------+
> | count(*) |
> +----------+
> |   593923 |
> +----------+
> 1 row in set (5.90 sec)
> 
> mysql> select count(*) from feeds where pubdate > 0;
> +----------+
> | count(*) |
> +----------+
> |   287532 |
> +----------+
> 1 row in set (5.33 sec)
> 
> 
> 
> 
> 
> 
> -- 
> Sometimes life hits you in the head with a brick. 
> Don't lose faith.
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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

Reply via email to