Re: [PHP] Function mktime() documentation question

2012-03-12 Thread Ashley Sheridan
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

Re: [PHP] Function mktime() documentation question

2012-03-12 Thread Tedd Sperling
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

Re: [PHP] Function mktime() documentation question

2012-03-11 Thread Matijn Woudt
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

Re: [PHP] Function mktime() documentation question

2012-03-11 Thread Tedd Sperling
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,

Re: [PHP] Function mktime() documentation question

2012-03-11 Thread Ashley Sheridan
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

Re: [PHP] Function mktime() documentation question

2012-03-10 Thread Tedd Sperling
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

Re: [PHP] Function mktime() documentation question

2012-03-10 Thread Matijn Woudt
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

Re: [PHP] Function mktime() documentation question

2012-03-10 Thread tamouse mailing lists
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

Re: [PHP] Function mktime() documentation question

2012-03-10 Thread Maciek Sokolewicz
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

Re: [PHP] Function mktime() documentation question

2012-03-10 Thread Matijn Woudt
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

Re: [PHP] Function mktime() documentation question

2012-03-10 Thread Maciek Sokolewicz
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

Re: [PHP] Function mktime() documentation question

2012-03-09 Thread Tedd Sperling
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

Re: [PHP] Function mktime() documentation question

2012-03-09 Thread Charles
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,

Re: [PHP] Function mktime() documentation question

2012-03-09 Thread Ashley Sheridan
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:

Re: [PHP] Function mktime() documentation question

2012-03-09 Thread Charles
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

Fwd: [PHP] Function mktime() documentation question

2012-03-09 Thread Andrew Ballard
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

Re: [PHP] Function mktime() documentation question

2012-03-09 Thread Charles
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

Re: [PHP] Function mktime() documentation question

2012-03-09 Thread Tedd Sperling
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

Re: [PHP] Function mktime() documentation question

2012-03-09 Thread Charles
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? >> >>

Re: [PHP] Function mktime() documentation question

2012-03-09 Thread Tedd Sperling
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

Re: [PHP] Function mktime() documentation question

2012-03-09 Thread Daniel Brown
(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

Re: [PHP] Function mktime() documentation question

2012-03-09 Thread Lester Caine
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

RE: [PHP] Function mktime() documentation question

2012-03-09 Thread Ford, Mike
> -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

Re: [PHP] Function mktime() documentation question

2012-03-08 Thread Charles
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

Re: [PHP] Function mktime() documentation question

2012-03-08 Thread Tedd Sperling
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

Re: [PHP] Function mktime() documentation question

2012-03-08 Thread Jim Lucas
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

Re: [PHP] Function mktime() documentation question

2012-03-08 Thread Jim Lucas
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

Re: [PHP] Function mktime() documentation question

2012-03-08 Thread Jim Lucas
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

Re: [PHP] Function mktime() documentation question

2012-03-08 Thread Jim Lucas
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

Re: [PHP] Function mktime() documentation question

2012-03-08 Thread Daniel Brown
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

Re: [PHP] Function mktime() documentation question

2012-03-08 Thread Tedd Sperling
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?

Re: [PHP] Function mktime() documentation question

2012-03-08 Thread Tedd Sperling
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

Re: [PHP] Function mktime() documentation question

2012-03-07 Thread Charles
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

Re: [PHP] Function mktime() documentation question

2012-03-07 Thread Simon Schick
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

Re: [PHP] Function mktime() documentation question

2012-03-07 Thread shiplu
> 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

Re: [PHP] Function mktime() documentation question

2012-03-07 Thread Daniel Brown
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

RE: [PHP] Function mktime() documentation question

2012-03-07 Thread admin
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

[PHP] Function mktime() documentation question

2012-03-07 Thread Tedd Sperling
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