Mysql gives what I'd call incorrect output when outputing week and years at
the end of the year.

PHP handles this correctly -- if I do a date("W-y", $date) for '2001-12-31'
I get '01-02', but in mysql you get the wrong year:  '01-01'

Here's the an example (the second one is not what I'd expect):

SELECT DATE_FORMAT('2001-12-25', '%v-%y');
+------------------------------------+
| DATE_FORMAT('2001-12-25', '%v-%y') |
+------------------------------------+
| 52-01                                             |
+------------------------------------+

SELECT DATE_FORMAT('2001-12-31', '%v-%y');
+------------------------------------+
| DATE_FORMAT('2001-12-31', '%v-%y') |
+------------------------------------+
| 01-01                                              |
+------------------------------------+

SELECT DATE_FORMAT('2002-01-05', '%v-%y');
+------------------------------------+
| DATE_FORMAT('2002-01-05', '%v-%y') |
+------------------------------------+
| 01-02                                             |
+------------------------------------+

I'm using mysql version 3.23.51-log, and I haven't seen anything with
DATE_FORMAT in the changelog since.

Do people agree that this is a bug?
Is there any work around for this?

Thanks,

Joe


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to