RE: [PHP] Server's clock gone funny, maybe?
| From: | Ed Lazor | Date: | Thu, 29 Jul 2004 18:07:35 +0000 |
| Subject: | RE: [PHP] Server's clock gone funny, maybe? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-192228@lists.php.net to get a copy of this message | ||
Maybe they've upgraded something on the server that's somehow affecting your
code?
Against MySQL 4.0.18
Query: select NOW()
Results: 2004-07-29 10:48:12
Query: select NOW()+3000000
Results: 20040732104424
The difference in result data format would lead to the problem you're
experiencing. In other words, you're suddenly trying to store a big number
into a date or date_time field and that doesn't work.
Depending on which version of MySQL you're using, try one of these:
(MySQL 4.1.1 and later)
update table set expire = ADDDATE(CURDATE(), 3) where ...
(older versions)
update table set expire = interval 3 day + CURDATE() where ...
> -----Original Message-----
> I've got a function where I reset an expiration datetime to 3 days in
> the future, using:
>
> update table set expire = NOW()+3000000 where ...
>
> Has always worked great, but today it always sets the field to
> 0000-00-00 00:00:00. No code was touched. Anyone have a clue? A problem
> with the ISP's server clock?