php-general Digest 9 Mar 2012 11:25:57 -0000 Issue 7719

Topics (messages 316940 through 316949):

Re: Function mktime() documentation question
        316940 by: Tedd Sperling
        316941 by: Daniel Brown
        316942 by: Jim Lucas
        316943 by: Jim Lucas
        316944 by: Jim Lucas
        316945 by: Jim Lucas
        316946 by: Tedd Sperling
        316947 by: Charles
        316948 by: Ford, Mike
        316949 by: Lester Caine

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
>> -----Original Message-----
>> From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
>> From my code, the number of days in a month can be found by using 0
>> as the first index of the next month -- not the last day of the
>> previous month.
> 
> Huh? The 0th day of next month *is* the last day of the current month,
> which gives you the number of days in the current month. QED.
> I think it's possible you may be being confuzled by the number of
> nexts and previouses floating around. Your mktime call is asking for
> the 0th day of next month, i.e. the last day of the previous month of
> next month, i.e. the last day of the current month. Which is exactly
> what you say works. I think. :)
> 
> However, I agree that the description is not very well worded - saying
> that days in the requested month are relative to the previous month is
> very odd indeed if you ask me -- if they must be relative to anything,
> why not the beginning of the relevant month? Actually, with a bit more
> thought, I think I'd rewrite it something like this:
> 
> The day number relative to the given month. Day numbers 1 to 28, 29,
> 30 or 31 (depending on the month) refer to the normal days in the
> month. Numbers less than 1 refer to days in the previous month, so 0
> is the last day of the preceding month, -1 the day before that, etc.
> Numbers greater than the actual number of days in the month refer to
> days in the following month(s).
> 

Mike:

Very well put. 

You say:

> Huh? The 0th day of next month *is* the last day of the current month,
> which gives you the number of days in the current month.

That IS exactly what I am saying.

But why does anyone have to use the next month to figure out how many days 
there are are in this month? Do you see my point?

It would have been better if one could use:

$what_date = getdate(mktime(0, 0, 0, $this_month, 0, $year)); 
$days_in_this_month = $what_date['nday']; // note an additional key for 
getdate()

But instead, we have to use:

$next_month = $this_month +1;
$what_date = getdate(mktime(0, 0, 0, $next_month, 0, $year)); 
$days_in_this_month = $what_date['mday'];

Additionally, there's a perception problem. You say that 0 of the next month 
*is* the last day of the current month -- as such, apparently months overlap in 
your (and Dan's) explanation. Well... I agree with both of you, but my 
objection is having to increase the month value by one to get the number of 
days in the current month.

That's all I was saying.

Side-point: I find it interesting that getdate() has all sorts of neat 
descriptions for the current month (such as, what weekday a numbered day is), 
but lacks how many days are in the month. Doesn't that seem odd?

Cheers,

tedd

_____________________
tedd.sperl...@gmail.com
http://sperling.com











--- End Message ---
--- Begin Message ---
On Mar 8, 2012 6:14 PM, "Tedd Sperling" <tedd.sperl...@gmail.com> wrote:
>
> On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
> >> -----Original Message-----
> >> From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
> >> From my code, the number of days in a month can be found by using 0
> >> as the first index of the next month -- not the last day of the
> >> previous month.
> >
> > Huh? The 0th day of next month *is* the last day of the current month,
> > which gives you the number of days in the current month. QED.
> > I think it's possible you may be being confuzled by the number of
> > nexts and previouses floating around. Your mktime call is asking for
> > the 0th day of next month, i.e. the last day of the previous month of
> > next month, i.e. the last day of the current month. Which is exactly
> > what you say works. I think. :)
> >
> > However, I agree that the description is not very well worded - saying
> > that days in the requested month are relative to the previous month is
> > very odd indeed if you ask me -- if they must be relative to anything,
> > why not the beginning of the relevant month? Actually, with a bit more
> > thought, I think I'd rewrite it something like this:
> >
> > The day number relative to the given month. Day numbers 1 to 28, 29,
> > 30 or 31 (depending on the month) refer to the normal days in the
> > month. Numbers less than 1 refer to days in the previous month, so 0
> > is the last day of the preceding month, -1 the day before that, etc.
> > Numbers greater than the actual number of days in the month refer to
> > days in the following month(s).
> >
>
> Mike:
>
> Very well put.
>
> You say:
>
> > Huh? The 0th day of next month *is* the last day of the current month,
> > which gives you the number of days in the current month.
>
> That IS exactly what I am saying.
>
> But why does anyone have to use the next month to figure out how many
days there are are in this month? Do you see my point?
>
> It would have been better if one could use:
>
> $what_date = getdate(mktime(0, 0, 0, $this_month, 0, $year));
> $days_in_this_month = $what_date['nday']; // note an additional key for
getdate()
>
> But instead, we have to use:
>
> $next_month = $this_month +1;
> $what_date = getdate(mktime(0, 0, 0, $next_month, 0, $year));
> $days_in_this_month = $what_date['mday'];
>
> Additionally, there's a perception problem. You say that 0 of the next
month *is* the last day of the current month -- as such, apparently months
overlap in your (and Dan's) explanation. Well... I agree with both of you,
but my objection is having to increase the month value by one to get the
number of days in the current month.
>
> That's all I was saying.
>
> Side-point: I find it interesting that getdate() has all sorts of neat
descriptions for the current month (such as, what weekday a numbered day
is), but lacks how many days are in the month. Doesn't that seem odd?

Oh, I see what you're saying now.  Well, using getdate(), how else would
you think to pass the parameter to get the last day other than using the
current month and the last day (which would then obviously be overkill, of
course).

All of this aside, though, you may instead want to use something along the
lines of date('d',strtotime('last day of this month')); in tandem with your
date formatting.

--- End Message ---
--- Begin Message ---
On 03/08/2012 03:14 PM, Tedd Sperling wrote:
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
-----Original Message-----
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
 From my code, the number of days in a month can be found by using 0
as the first index of the next month -- not the last day of the
previous month.

Huh? The 0th day of next month *is* the last day of the current month,
which gives you the number of days in the current month. QED.
I think it's possible you may be being confuzled by the number of
nexts and previouses floating around. Your mktime call is asking for
the 0th day of next month, i.e. the last day of the previous month of
next month, i.e. the last day of the current month. Which is exactly
what you say works. I think. :)

However, I agree that the description is not very well worded - saying
that days in the requested month are relative to the previous month is
very odd indeed if you ask me -- if they must be relative to anything,
why not the beginning of the relevant month? Actually, with a bit more
thought, I think I'd rewrite it something like this:

The day number relative to the given month. Day numbers 1 to 28, 29,
30 or 31 (depending on the month) refer to the normal days in the
month. Numbers less than 1 refer to days in the previous month, so 0
is the last day of the preceding month, -1 the day before that, etc.
Numbers greater than the actual number of days in the month refer to
days in the following month(s).


Mike:

Very well put.

You say:

Huh? The 0th day of next month *is* the last day of the current month,
which gives you the number of days in the current month.

That IS exactly what I am saying.

But why does anyone have to use the next month to figure out how many days 
there are are in this month? Do you see my point?

It would have been better if one could use:

$what_date = getdate(mktime(0, 0, 0, $this_month, 0, $year));
$days_in_this_month = $what_date['nday']; // note an additional key for 
getdate()

But instead, we have to use:

$next_month = $this_month +1;
$what_date = getdate(mktime(0, 0, 0, $next_month, 0, $year));
$days_in_this_month = $what_date['mday'];

Additionally, there's a perception problem. You say that 0 of the next month 
*is* the last day of the current month -- as such, apparently months overlap in 
your (and Dan's) explanation. Well... I agree with both of you, but my 
objection is having to increase the month value by one to get the number of 
days in the current month.

That's all I was saying.

Side-point: I find it interesting that getdate() has all sorts of neat 
descriptions for the current month (such as, what weekday a numbered day is), 
but lacks how many days are in the month. Doesn't that seem odd?

Cheers,

tedd

_____________________
tedd.sperl...@gmail.com
http://sperling.com

I am surprised that nobody has come up with this one yet.

$what_date = getdate(mktime(0, 0, 0, $this_month, 35, $year));
$days_in_this_month = 35 - $what_date['mday'];



--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
http://www.bendsource.com/

--- End Message ---
--- Begin Message ---
On 03/08/2012 04:24 PM, Jim Lucas wrote:
On 03/08/2012 03:14 PM, Tedd Sperling wrote:
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
-----Original Message-----
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
From my code, the number of days in a month can be found by using 0
as the first index of the next month -- not the last day of the
previous month.

Huh? The 0th day of next month *is* the last day of the current month,
which gives you the number of days in the current month. QED.
I think it's possible you may be being confuzled by the number of
nexts and previouses floating around. Your mktime call is asking for
the 0th day of next month, i.e. the last day of the previous month of
next month, i.e. the last day of the current month. Which is exactly
what you say works. I think. :)

However, I agree that the description is not very well worded - saying
that days in the requested month are relative to the previous month is
very odd indeed if you ask me -- if they must be relative to anything,
why not the beginning of the relevant month? Actually, with a bit more
thought, I think I'd rewrite it something like this:

The day number relative to the given month. Day numbers 1 to 28, 29,
30 or 31 (depending on the month) refer to the normal days in the
month. Numbers less than 1 refer to days in the previous month, so 0
is the last day of the preceding month, -1 the day before that, etc.
Numbers greater than the actual number of days in the month refer to
days in the following month(s).


Mike:

Very well put.

You say:

Huh? The 0th day of next month *is* the last day of the current month,
which gives you the number of days in the current month.

That IS exactly what I am saying.

But why does anyone have to use the next month to figure out how many
days there are are in this month? Do you see my point?

It would have been better if one could use:

$what_date = getdate(mktime(0, 0, 0, $this_month, 0, $year));
$days_in_this_month = $what_date['nday']; // note an additional key
for getdate()

But instead, we have to use:

$next_month = $this_month +1;
$what_date = getdate(mktime(0, 0, 0, $next_month, 0, $year));
$days_in_this_month = $what_date['mday'];

Additionally, there's a perception problem. You say that 0 of the next
month *is* the last day of the current month -- as such, apparently
months overlap in your (and Dan's) explanation. Well... I agree with
both of you, but my objection is having to increase the month value by
one to get the number of days in the current month.

That's all I was saying.

Side-point: I find it interesting that getdate() has all sorts of neat
descriptions for the current month (such as, what weekday a numbered
day is), but lacks how many days are in the month. Doesn't that seem odd?

Cheers,

tedd

_____________________
tedd.sperl...@gmail.com
http://sperling.com

I am surprised that nobody has come up with this one yet.

$what_date = getdate(mktime(0, 0, 0, $this_month, 35, $year));
$days_in_this_month = 35 - $what_date['mday'];

Even a one liner...

$what_date = getdate(mktime(0,0,0,$this_month,35,$year)-(35 * 86400));


--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
http://www.bendsource.com/

--- End Message ---
--- Begin Message ---
On 03/08/2012 04:31 PM, Jim Lucas wrote:
On 03/08/2012 04:24 PM, Jim Lucas wrote:
On 03/08/2012 03:14 PM, Tedd Sperling wrote:
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
-----Original Message-----
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
From my code, the number of days in a month can be found by using 0
as the first index of the next month -- not the last day of the
previous month.

Huh? The 0th day of next month *is* the last day of the current month,
which gives you the number of days in the current month. QED.
I think it's possible you may be being confuzled by the number of
nexts and previouses floating around. Your mktime call is asking for
the 0th day of next month, i.e. the last day of the previous month of
next month, i.e. the last day of the current month. Which is exactly
what you say works. I think. :)

However, I agree that the description is not very well worded - saying
that days in the requested month are relative to the previous month is
very odd indeed if you ask me -- if they must be relative to anything,
why not the beginning of the relevant month? Actually, with a bit more
thought, I think I'd rewrite it something like this:

The day number relative to the given month. Day numbers 1 to 28, 29,
30 or 31 (depending on the month) refer to the normal days in the
month. Numbers less than 1 refer to days in the previous month, so 0
is the last day of the preceding month, -1 the day before that, etc.
Numbers greater than the actual number of days in the month refer to
days in the following month(s).


Mike:

Very well put.

You say:

Huh? The 0th day of next month *is* the last day of the current month,
which gives you the number of days in the current month.

That IS exactly what I am saying.

But why does anyone have to use the next month to figure out how many
days there are are in this month? Do you see my point?

It would have been better if one could use:

$what_date = getdate(mktime(0, 0, 0, $this_month, 0, $year));
$days_in_this_month = $what_date['nday']; // note an additional key
for getdate()

But instead, we have to use:

$next_month = $this_month +1;
$what_date = getdate(mktime(0, 0, 0, $next_month, 0, $year));
$days_in_this_month = $what_date['mday'];

Additionally, there's a perception problem. You say that 0 of the next
month *is* the last day of the current month -- as such, apparently
months overlap in your (and Dan's) explanation. Well... I agree with
both of you, but my objection is having to increase the month value by
one to get the number of days in the current month.

That's all I was saying.

Side-point: I find it interesting that getdate() has all sorts of neat
descriptions for the current month (such as, what weekday a numbered
day is), but lacks how many days are in the month. Doesn't that seem
odd?

Cheers,

tedd

_____________________
tedd.sperl...@gmail.com
http://sperling.com

I am surprised that nobody has come up with this one yet.

$what_date = getdate(mktime(0, 0, 0, $this_month, 35, $year));
$days_in_this_month = 35 - $what_date['mday'];

Even a one liner...

$what_date = getdate(mktime(0,0,0,$this_month,35,$year)-(35 * 86400));



Sorry, had my math backwards...

$what_date = getdate((35 * 86400)-mktime(0,0,0,$this_month,35,$year));

--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
http://www.bendsource.com/

--- End Message ---
--- Begin Message ---
On 03/08/2012 04:44 PM, Jim Lucas wrote:
On 03/08/2012 04:31 PM, Jim Lucas wrote:
On 03/08/2012 04:24 PM, Jim Lucas wrote:
On 03/08/2012 03:14 PM, Tedd Sperling wrote:
On Mar 8, 2012, at 11:20 AM, Ford, Mike wrote:
-----Original Message-----
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
From my code, the number of days in a month can be found by using 0
as the first index of the next month -- not the last day of the
previous month.

Huh? The 0th day of next month *is* the last day of the current month,
which gives you the number of days in the current month. QED.
I think it's possible you may be being confuzled by the number of
nexts and previouses floating around. Your mktime call is asking for
the 0th day of next month, i.e. the last day of the previous month of
next month, i.e. the last day of the current month. Which is exactly
what you say works. I think. :)

However, I agree that the description is not very well worded - saying
that days in the requested month are relative to the previous month is
very odd indeed if you ask me -- if they must be relative to anything,
why not the beginning of the relevant month? Actually, with a bit more
thought, I think I'd rewrite it something like this:

The day number relative to the given month. Day numbers 1 to 28, 29,
30 or 31 (depending on the month) refer to the normal days in the
month. Numbers less than 1 refer to days in the previous month, so 0
is the last day of the preceding month, -1 the day before that, etc.
Numbers greater than the actual number of days in the month refer to
days in the following month(s).


Mike:

Very well put.

You say:

Huh? The 0th day of next month *is* the last day of the current month,
which gives you the number of days in the current month.

That IS exactly what I am saying.

But why does anyone have to use the next month to figure out how many
days there are are in this month? Do you see my point?

It would have been better if one could use:

$what_date = getdate(mktime(0, 0, 0, $this_month, 0, $year));
$days_in_this_month = $what_date['nday']; // note an additional key
for getdate()

But instead, we have to use:

$next_month = $this_month +1;
$what_date = getdate(mktime(0, 0, 0, $next_month, 0, $year));
$days_in_this_month = $what_date['mday'];

Additionally, there's a perception problem. You say that 0 of the next
month *is* the last day of the current month -- as such, apparently
months overlap in your (and Dan's) explanation. Well... I agree with
both of you, but my objection is having to increase the month value by
one to get the number of days in the current month.

That's all I was saying.

Side-point: I find it interesting that getdate() has all sorts of neat
descriptions for the current month (such as, what weekday a numbered
day is), but lacks how many days are in the month. Doesn't that seem
odd?

Cheers,

tedd

_____________________
tedd.sperl...@gmail.com
http://sperling.com

I am surprised that nobody has come up with this one yet.

$what_date = getdate(mktime(0, 0, 0, $this_month, 35, $year));
$days_in_this_month = 35 - $what_date['mday'];

Even a one liner...

$what_date = getdate(mktime(0,0,0,$this_month,35,$year)-(35 * 86400));



Sorry, had my math backwards...

$what_date = getdate((35 * 86400)-mktime(0,0,0,$this_month,35,$year));


Spoke too soon. Since you have to know the output of getdate() to calculate the minus figure... I guess that won't work. Use the first one that I suggested.

--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
http://www.bendsource.com/

--- End Message ---
--- Begin Message ---
On Mar 8, 2012, at 6:53 PM, Daniel Brown wrote:
On Mar 8, 2012 6:14 PM, "Tedd Sperling" <tedd.sperl...@gmail.com> wrote:
> 
> > Side-point: I find it interesting that getdate() has all sorts of neat 
> > descriptions for the current month (such as, what weekday a numbered day 
> > is), but lacks how many days are in the month. Doesn't that seem odd?
> 
> Oh, I see what you're saying now.  Well, using getdate(), how else would you 
> think to pass the parameter to get the last day other than using the current 
> month and the last day (which would then obviously be overkill, of course).

Well.. you could use any number that exceeds 31 -- or -- as I would have 
suggested if it had been up to me, zero day would provide the number of days in 
*that* month rather than the number of days in the previous month, which was 
the point of my post.

> All of this aside, though, you may instead want to use something along the 
> lines of date('d',strtotime('last day of this month')); in tandem with your 
> date formatting.

That's a good idea, but 

> date('d',strtotime('last day of this month'));


gives me the number of days in *this* month, but not the next, or previous, 
month.

I need the result to be whatever date was selected -- something like:

$number_days = date('d',strtotime('last day of April, 2014'));

But that doesn't work.

You see, I need something that makes sense to students. The idea that you have 
to use the zero day (whatever that is) of the next month to see how many days 
there are in this month is strange and confusing -- again my point.

Thus far, the following looks better than what I came up with::

$what_date = getdate(mktime(0, 0, 0, $mon, 32, $year));
$days_in_month = 32 - $what_date['mday'];

But it's still strange.

I was using:

        // get the last day of the month
        $cont = true;
        $tday = 27;
        while (($tday <= 32) && ($cont))
                {
                $tdate = getdate(mktime(0,0,0,$mon,$tday,$year));
                if ($tdate["mon"] != $mon)
                        {
                        $lastday = $tday - 1;
                        $cont = false;
                        }
                $tday++;
                }

It made sense, but was too long. I figured there should be something better and 
easier to explain -- but I'm still looking.

Cheers


tedd

_____________________
tedd.sperl...@gmail.com
http://sperling.com






--- End Message ---
--- Begin Message ---
On Fri, Mar 9, 2012 at 9:23 AM, Tedd Sperling <tedd.sperl...@gmail.com> wrote:
> On Mar 8, 2012, at 6:53 PM, Daniel Brown wrote:
> On Mar 8, 2012 6:14 PM, "Tedd Sperling" <tedd.sperl...@gmail.com> wrote:
>>
>> > Side-point: I find it interesting that getdate() has all sorts of neat 
>> > descriptions for the current month (such as, what weekday a numbered day 
>> > is), but lacks how many days are in the month. Doesn't that seem odd?
>>
>> Oh, I see what you're saying now.  Well, using getdate(), how else would you 
>> think to pass the parameter to get the last day other than using the current 
>> month and the last day (which would then obviously be overkill, of course).
>
> Well.. you could use any number that exceeds 31 -- or -- as I would have 
> suggested if it had been up to me, zero day would provide the number of days 
> in *that* month rather than the number of days in the previous month, which 
> was the point of my post.
>
>> All of this aside, though, you may instead want to use something along the 
>> lines of date('d',strtotime('last day of this month')); in tandem with your 
>> date formatting.
>
> That's a good idea, but
>
>> date('d',strtotime('last day of this month'));
>
>
> gives me the number of days in *this* month, but not the next, or previous, 
> month.
>
> I need the result to be whatever date was selected -- something like:
>
> $number_days = date('d',strtotime('last day of April, 2014'));
>
> But that doesn't work.
>
> You see, I need something that makes sense to students. The idea that you 
> have to use the zero day (whatever that is) of the next month to see how many 
> days there are in this month is strange and confusing -- again my point.
>
> Thus far, the following looks better than what I came up with::
>
> $what_date = getdate(mktime(0, 0, 0, $mon, 32, $year));
> $days_in_month = 32 - $what_date['mday'];
>
> But it's still strange.
>
> I was using:
>
>        // get the last day of the month
>        $cont = true;
>        $tday = 27;
>        while (($tday <= 32) && ($cont))
>                {
>                $tdate = getdate(mktime(0,0,0,$mon,$tday,$year));
>                if ($tdate["mon"] != $mon)
>                        {
>                        $lastday = $tday - 1;
>                        $cont = false;
>                        }
>                $tday++;
>                }
>
> It made sense, but was too long. I figured there should be something better 
> and easier to explain -- but I'm still looking.

function count_days($month, $year) { return (mktime(0, 0, 0, $month+1,
1, $year) - mktime(0, 0, 0, $month, 1, $year))/86400; }

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
> Sent: 08 March 2012 23:15
> To: PHP-General List

[previous discussion snipped]
 
 
> Mike:
> 
> Very well put.
> 
> You say:
> 
> > Huh? The 0th day of next month *is* the last day of the current
> month,
> > which gives you the number of days in the current month.
> 
> That IS exactly what I am saying.
> 
> But why does anyone have to use the next month to figure out how
> many days there are are in this month? Do you see my point?

Actually, no. To figure this out, somewhere along the line you've
got to know where the last day of this month / first day of next
month boundary lies, so I don't see how you can ever find the number
of days in a month without bringing the start of next month into it
somehow. (Even if it's implicitly be getting someone else's clever
code to figure out 'last day of this month'!)
 
> It would have been better if one could use:
> 
> $what_date = getdate(mktime(0, 0, 0, $this_month, 0, $year));
> $days_in_this_month = $what_date['nday']; // note an additional key
> for getdate()

But that $what_date would still refer to a day in *last* month!
(Which isn't going to change, as it would be a significant BC break.)

> But instead, we have to use:
> 
> $next_month = $this_month +1;
> $what_date = getdate(mktime(0, 0, 0, $next_month, 0, $year));
> $days_in_this_month = $what_date['mday'];

To me, that's a clever and elegant solution. It's clear that our
brains just work differently on this one.

> Additionally, there's a perception problem. You say that 0 of the
> next month *is* the last day of the current month -- as such,
> apparently months overlap in your (and Dan's) explanation. Well... I
> agree with both of you, but my objection is having to increase the
> month value by one to get the number of days in the current month.

Not overlap as such, I don't think -- there's just a continuum such
that the 0th of a month is the day before the 1st (and hence the last
day of the preceding month!), the -1th is the day before that and so
on; likewise, the 32nd is the day after the 31st, and so on.

> Side-point: I find it interesting that getdate() has all sorts of
> neat descriptions for the current month (such as, what weekday a
> numbered day is), but lacks how many days are in the month. Doesn't
> that seem odd?

Now that's a decent point: I can see where you're coming from with that
one. I don't know what performance penalty there might be (if any) to
calculate that for every call to getdate(), but it certainly seems like
a reasonable feature request.

(And, actually, I think we should be quite grateful that mktime()
*does* take out-of-range values and do appropriate things with them --
if it didn't, I suspect the only way to do this job might be a loop
similar to the one posted by Tedd, but adding chunks of 86400 to a raw
timestamp. Now that really would be a bit obscure!!!)

Cheers!

Mike

-- 
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,  
Portland PD507, City Campus, Leeds Metropolitan University,
Portland Way, LEEDS,  LS1 3HE,  United Kingdom 
E: m.f...@leedsmet.ac.uk     T: +44 113 812 4730





To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

--- End Message ---
--- Begin Message ---
Ford, Mike wrote:
Side-point: I find it interesting that getdate() has all sorts of
>  neat descriptions for the current month (such as, what weekday a
>  numbered day is), but lacks how many days are in the month. Doesn't
>  that seem odd?
Now that's a decent point: I can see where you're coming from with that
one. I don't know what performance penalty there might be (if any) to
calculate that for every call to getdate(), but it certainly seems like
a reasonable feature request.

I've never had this problem ;)
http://phplens.com/phpeverywhere/adodb_date_library

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--- End Message ---

Reply via email to