On Mon, 2012-03-12 at 15:53 -0400, Tedd Sperling wrote:
> On Mar 11, 2012, at 3:10 PM, Matijn Woudt wrote:
> > On Sun, Mar 11, 2012 at 7:33 PM, Tedd Sperling
> > wrote:
> >> Actually, this works for me:
> >>
> >> $days_in_month = date('t', mktime(0, 0, 0, $next_month, 0, $year));
> >>
> >> But
On Mar 11, 2012, at 3:10 PM, Matijn Woudt wrote:
> On Sun, Mar 11, 2012 at 7:33 PM, Tedd Sperling
> wrote:
>> Actually, this works for me:
>>
>> $days_in_month = date('t', mktime(0, 0, 0, $next_month, 0, $year));
>>
>> But again, I don't see why I have to use "next month" to find the number of
On Sun, Mar 11, 2012 at 7:33 PM, Tedd Sperling wrote:
> On Mar 11, 2012, at 6:12 AM, Ashley Sheridan wrote:
>>
>> I still don't see what's wrong with
>>
>> date("t");
>>
>> --
>> Thanks,
>> Ash
>
> Ash:
>
> It's just too damn simple -- we need to make things complicated. :-)
>
> Actually, this wor
On Mar 11, 2012, at 6:12 AM, Ashley Sheridan wrote:
>
> I still don't see what's wrong with
>
> date("t");
>
> --
> Thanks,
> Ash
Ash:
It's just too damn simple -- we need to make things complicated. :-)
Actually, this works for me:
$days_in_month = date('t', mktime(0, 0, 0, $next_month, 0,
On Sat, 2012-03-10 at 20:38 -0500, Tedd Sperling wrote:
> On Mar 10, 2012, at 12:20 PM, Maciek Sokolewicz wrote:
>
> > function getAmountOfDaysInAMonth($month, $year) {
> > $days = array(31, (($year%4==0 and ($year%100 > 0 or $year%400==0)) ? 29
> > : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 3
On Mar 10, 2012, at 12:20 PM, Maciek Sokolewicz wrote:
> function getAmountOfDaysInAMonth($month, $year) {
> $days = array(31, (($year%4==0 and ($year%100 > 0 or $year%400==0)) ? 29 :
> 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
> return $days[$month+1];
> }
I like that -- here's a small
On Sat, Mar 10, 2012 at 9:47 PM, tamouse mailing lists
wrote:
> I'm just a bit baffled why this isn't a standard library function.
Good question, but I think the problem here is that there are tons of
these small functions, and you got to make a choice on what to
implement and what not. I can thi
I'm just a bit baffled why this isn't a standard library function.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 10 March 2012 19:06, Matijn Woudt wrote:
> On Sat, Mar 10, 2012 at 6:20 PM, Maciek Sokolewicz
> wrote:
> > On 09-03-2012 14:11, Daniel Brown wrote:
> >>
> >> (To the list, as well. First day with my new fingers,
> apparently)
> >>
> >> On Fri, Mar 9, 2012 at 08:09, Daniel Brown wrot
On Sat, Mar 10, 2012 at 6:20 PM, Maciek Sokolewicz
wrote:
> On 09-03-2012 14:11, Daniel Brown wrote:
>>
>> (To the list, as well. First day with my new fingers, apparently)
>>
>> On Fri, Mar 9, 2012 at 08:09, Daniel Brown wrote:
>>>
>>> On Thu, Mar 8, 2012 at 21:23, Tedd Sperling
>>> wr
On 09-03-2012 14:11, Daniel Brown wrote:
(To the list, as well. First day with my new fingers, apparently)
On Fri, Mar 9, 2012 at 08:09, Daniel Brown wrote:
On Thu, Mar 8, 2012 at 21:23, Tedd Sperling wrote:
This starts getting a bit off-topic from your original email, but
know
On Mar 9, 2012, at 12:52 PM, Charles wrote:
> On Sat, Mar 10, 2012 at 12:07 AM, Tedd Sperling
> wrote:
>>
>> Well no, I don't need to know the first day of next month to know the last
>> day of this month. That's like saying "I need to know who is going to stand
>> at the 'end of the line' NEX
On Sat, Mar 10, 2012 at 12:57 AM, Charles wrote:
> On Sat, Mar 10, 2012 at 12:52 AM, Charles wrote:
>> On Sat, Mar 10, 2012 at 12:07 AM, Tedd Sperling
>> wrote:
>>> On Mar 9, 2012, at 11:17 AM, Charles wrote:
>>>
On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling
wrote:
> On Mar 9,
Charles wrote:
>On Sat, Mar 10, 2012 at 12:52 AM, Charles wrote:
>> On Sat, Mar 10, 2012 at 12:07 AM, Tedd Sperling
> wrote:
>>> On Mar 9, 2012, at 11:17 AM, Charles wrote:
>>>
On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling
> wrote:
> On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
On Sat, Mar 10, 2012 at 12:52 AM, Charles wrote:
> On Sat, Mar 10, 2012 at 12:07 AM, Tedd Sperling
> wrote:
>> On Mar 9, 2012, at 11:17 AM, Charles wrote:
>>
>>> On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling
>>> wrote:
On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
>> From: Tedd Sperl
And again to the list, since for some reason "Reply-to-all" did not do
as intended this time.
-- Forwarded message --
From: Andrew Ballard
Date: Fri, Mar 9, 2012 at 12:53 PM
Subject: Re: [PHP] Function mktime() documentation question
To: Tedd Sperling
On Fri, Mar
On Sat, Mar 10, 2012 at 12:07 AM, Tedd Sperling wrote:
> On Mar 9, 2012, at 11:17 AM, Charles wrote:
>
>> On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling
>> wrote:
>>> On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
> From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
> But why does anyon
On Mar 9, 2012, at 11:17 AM, Charles wrote:
> On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling
> wrote:
>> On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
But why does anyone have to use the next month to figure out how
many days th
On Fri, Mar 9, 2012 at 10:58 PM, Tedd Sperling wrote:
> On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
>>> From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
>>> 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?
>>
>>
On Mar 9, 2012, at 5:37 AM, Ford, Mike wrote:
>> From: Tedd Sperling [mailto:tedd.sperl...@gmail.com]
>> 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 yo
(To the list, as well. First day with my new fingers, apparently)
On Fri, Mar 9, 2012 at 08:09, Daniel Brown wrote:
> On Thu, Mar 8, 2012 at 21:23, Tedd Sperling wrote:
>
> This starts getting a bit off-topic from your original email, but
> knowing that you're trying to use it for te
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 comin
> -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,
> > whi
On Fri, Mar 9, 2012 at 9:23 AM, Tedd Sperling wrote:
> On Mar 8, 2012, at 6:53 PM, Daniel Brown wrote:
> On Mar 8, 2012 6:14 PM, "Tedd Sperling" wrote:
>>
>> > Side-point: I find it interesting that getdate() has all sorts of neat
>> > descriptions for the current month (such as, what weekday a
On Mar 8, 2012, at 6:53 PM, Daniel Brown wrote:
On Mar 8, 2012 6:14 PM, "Tedd Sperling" 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 mo
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
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 mo
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 i
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 da
On Mar 8, 2012 6: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 m
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?
On Mar 7, 2012, at 4:28 PM, Daniel Brown wrote:
> On Wed, Mar 7, 2012 at 15:03, Tedd Sperling wrote:
>> Hi gang:
>>
>> I am using the getdate(mktime()) functions to get month data (i.e., name of
>> month, first weekday, last day, number of days).
>>
>> To get the number of days for a specific
On Thu, Mar 8, 2012 at 7:01 AM, Simon Schick
wrote:
> $date = new DateTime($year . '-' . $current_month . '-1');
> $date->add( new DateInterval( 'P1M' ) ); // Add a period of 1 month to
> the date-instance (haven't tried that with the 30th of Jan ... would
> be kind-of interesting)
>
> $days_in_cu
Hi, All
To bring a work-around into this discussion I myself would not see it
as a good way to do it like that - even if the documentation provides
some information around that.
Here's what I have done in all new projects I worked with time-calculation:
@Tedd: Lets pick up your first example and
> To get the number of days for a specific month, I use:
>
> // $current_month is the month under question
>
> $next_month = $current_month + 1;
I use this
$next_month = $current_month + 1;
$next_month_1= mktime(0, 0, 0, $next_month, 1, date("Y") );
$current_month_1= mktime(0, 0, 0, $curr
On Wed, Mar 7, 2012 at 15:03, Tedd Sperling wrote:
> Hi gang:
>
> I am using the getdate(mktime()) functions to get month data (i.e., name of
> month, first weekday, last day, number of days).
>
> To get the number of days for a specific month, I use:
>
> // $current_month is the month under ques
tedd.sperl...@gmail.com]
Sent: Wednesday, March 07, 2012 3:04 PM
To: PHP-General List
Subject: [PHP] Function mktime() documentation question
Hi gang:
I am using the getdate(mktime()) functions to get month data (i.e., name of
month, first weekday, last day, number of days).
To get the num
Hi gang:
I am using the getdate(mktime()) functions to get month data (i.e., name of
month, first weekday, last day, number of days).
To get the number of days for a specific month, I use:
// $current_month is the month under question
$next_month = $current_month + 1;
$what_date = getda
38 matches
Mail list logo