Documentation correction: month(), dayofmonth()

Documentation correction: month(), dayofmonth()

am 22.06.2003 17:15:24 von danlo

The month and dayofmonth function will return illegal month and days
of zero.

http://www.mysql.com/documentation/mysql/bychapter/manual_Re ference.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_Re ference.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=gcdmb-bugs@m.gmane.org

Re: Documentation correction: month(), dayofmonth()

am 22.06.2003 19:06:48 von Paul DuBois

Thanks for your message.

Zero isn't an illegal month of day value. It applies in cases where a
date value is "incomplete", such as "1999-11-00" or "2003-00-00", which
MySQL allows to be stored in DATE columns. In these cases, the relevant
part of the date value is 0, which is what those functions will return.

However, you're correct that the function descriptions list return value
ranges that begin with 0. We can correct that, but I want to make sure
first of something else first: When you say that the functions return
an "illegal" value of 0, are you referring to some other case than what
I mention in the preceding paragraph?

Paul

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_R eference.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_R eference.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


--
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=gcdmb-bugs@m.gmane.org

Re[2]: Documentation correction: month(), dayofmonth()

am 22.06.2003 19:15:40 von danlo

Hello Paul,

I was only referring to case of an incomplete date.

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=gcdmb-bugs@m.gmane.org

Re[2]: Documentation correction: month(), dayofmonth()

am 22.06.2003 20:18:16 von Paul DuBois

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=gcdmb-bugs@m.gmane.org