Bug #41825 | Date_Format - works as designed! | ||
---|---|---|---|
Submitted: | 2 Jan 2009 9:10 | Modified: | 2 Jan 2009 11:19 |
Reporter: | Dennis Houchin | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: General | Severity: | S3 (Non-critical) |
Version: | 5.0 | OS: | Windows (Server 2003 R2) |
Assigned to: | CPU Architecture: | Any | |
Tags: | date_format, invalid date, wrong year |
[2 Jan 2009 9:10]
Dennis Houchin
[2 Jan 2009 9:43]
Valeriy Kravchuk
Sorry, but this is not a bug. Please, read the manual, http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format: "%X Year for the week where Sunday is the first day of the week, numeric, four digits; used with %V" This week started in 2008. Just use %Y: mysql> select -> date_format('2009-01-03','%m/%d/%Y') as WrongDate; +------------+ | WrongDate | +------------+ | 01/03/2009 | +------------+ 1 row in set (0.00 sec)
[2 Jan 2009 11:19]
Dennis Houchin
RTFM! The perfect answer. Thanks and apologies. DH