[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-bugs
Subject:    Re[2]: Documentation correction: month(), dayofmonth()
From:       Paul DuBois <paul () mysql ! com>
Date:       2003-06-22 18:18:16
[Download RAW message or body]

At 10:15 -0700 6/22/03, danlo wrote:
>Hello Paul,
>
>I was only referring to case of an incomplete date.

Thanks for the clarification.  I've added a note to the beginning of
the date function page to indicate that they may return zero in the case
of ``zero'' or incomplete dates.

>
>TIA,
>
>-daniel
>
>
>Sunday, June 22, 2003, 10:06:48 AM, you wrote:
>
>PD> Thanks for your message.
>
>PD> Zero isn't an illegal month of day value. It applies in cases where a
>PD> date value is "incomplete", such as "1999-11-00" or "2003-00-00", which
>PD> MySQL allows to be stored in DATE columns.  In these cases, the relevant
>PD> part of the date value is 0, which is what those functions will return.
>
>PD> However, you're correct that the function descriptions list return value
>PD> ranges that begin with 0.  We can correct that, but I want to make sure
>PD> first of something else first: When you say that the functions return
>PD> an "illegal" value of 0, are you referring to some other case than what
>PD> I mention in the preceding paragraph?
>
>PD> Paul
>
>PD> At 8:15 -0700 6/22/03, danlo wrote:
>>>The month and dayofmonth function will return illegal month and days
>>>of zero.
>>>
>>>http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Date_and_time_types
>>>
>>>To make the date checking 'fast', MySQL only checks that the month is
>>>in the range of 0-12 and the day is in the range of 0-31.
>>>
>>>Yet, month() and dayofmonth() function claim to return only valid values,
>>>when they will return a month of (0) or a day of (0).
>>>
>>>http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Date_and_time_functions
>>>
>>>DAYOFMONTH(date)
>>>Returns the day of the month for date, in the range 1 to 31:
>>>mysql> SELECT DAYOFMONTH('1998-02-03');
>>>          -> 3
>>>
>>>MONTH(date)
>>>Returns the month for date, in the range 1 to 12:
>>>mysql> SELECT MONTH('1998-02-03');
>>>          -> 2
>>>       
>>>
>>>Regards,
>>>
>>>
>>>-daniel
>>>
>>>PS.  Thank you for making a great database!
>>>
>>>--
>>>ANTISPAM TAG: 97asdljkFDS23rs
>>>Removing that TAG will cause your message to be
>>>moved to my junkmail box, where it may not be
>>>answered.
>>>
>>>
>>>--
>>>MySQL Bugs Mailing List
>>>For list archives: http://lists.mysql.com/bugs
>>>To unsubscribe:    http://lists.mysql.com/bugs?unsub=paul@mysql.com
>
>
>
>
>--
>ANTISPAM TAG: 97asdljkFDS23rs
>Removing that TAG will cause your message to be
>moved to my junkmail box, where it may not be
>answered.
>
>
>--
>MySQL Bugs Mailing List
>For list archives: http://lists.mysql.com/bugs
>To unsubscribe:    http://lists.mysql.com/bugs?unsub=paul@mysql.com


-- 
Paul DuBois, Senior Technical Writer
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

Are you MySQL certified?  http://www.mysql.com/certification/


-- 
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe:    http://lists.mysql.com/bugs?unsub=mysql-bugs@progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic