| Bug #2232 | now()-XXX give incorrect date time | ||
|---|---|---|---|
| Submitted: | 29 Dec 2003 1:37 | Modified: | 29 Dec 2003 2:11 |
| Reporter: | Chow Ka Hong | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server: Command-line Clients | Severity: | S2 (Serious) |
| Version: | 3.23.47-nt | OS: | Windows (Win 2000) |
| Assigned to: | CPU Architecture: | Any | |
[29 Dec 2003 1:37]
Chow Ka Hong
[29 Dec 2003 2:11]
Alexander Keremidarski
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.mysql.com/documentation/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php Additional info: In a way you are using it DATETIME values are converted to integer before subtraction This is well explained in the manual. What you need is to read about DATE_ADD/DATE_SUB functions: mysql> SELECT NOW(), NOW() - INTERVAL 30 SECOND; +---------------------+----------------------------+ | NOW() | NOW() - INTERVAL 30 SECOND | +---------------------+----------------------------+ | 2003-12-29 12:11:04 | 2003-12-29 12:10:34 | +---------------------+----------------------------+
