Re: [PHP] Date Issue

2008-11-18 Thread Andrew Ballard
On Tue, Nov 18, 2008 at 2:58 PM, Ashley Sheridan <[EMAIL PROTECTED]> wrote: > It just flew in the face of all I knew at the time to have a > non-associative system-generated array (by that I mean one whos keys are > integars and not string keys) that doesn't start at 0. No other arrays > defined in

Re: [PHP] Date Issue

2008-11-18 Thread Ashley Sheridan
eder [mailto:[EMAIL PROTECTED] > >> > Sent: Monday, November 17, 2008 4:50 PM > >> > To: Boyd, Todd M. > >> > Cc: [EMAIL PROTECTED]; php-general@lists.php.net > >> > Subject: Re: [PHP] Date Issue > >> > > >> > Boyd, Todd M. wrote

Re: [PHP] Date Issue

2008-11-18 Thread Andrew Ballard
50 PM >> > To: Boyd, Todd M. >> > Cc: [EMAIL PROTECTED]; php-general@lists.php.net >> > Subject: Re: [PHP] Date Issue >> > >> > Boyd, Todd M. wrote: >> > >> Are you sure this isn't like Javascript's "getMonth" function? Its &

RE: [PHP] Date Issue

2008-11-17 Thread Ashley Sheridan
On Mon, 2008-11-17 at 16:57 -0600, Boyd, Todd M. wrote: > > -Original Message- > > From: Craige Leeder [mailto:[EMAIL PROTECTED] > > Sent: Monday, November 17, 2008 4:50 PM > > To: Boyd, Todd M. > > Cc: [EMAIL PROTECTED]; php-general@lists.php.net >

RE: [PHP] Date Issue

2008-11-17 Thread Boyd, Todd M.
> -Original Message- > From: Craige Leeder [mailto:[EMAIL PROTECTED] > Sent: Monday, November 17, 2008 4:50 PM > To: Boyd, Todd M. > Cc: [EMAIL PROTECTED]; php-general@lists.php.net > Subject: Re: [PHP] Date Issue > > Boyd, Todd M. wrote: > >> Are you

Re: [PHP] Date Issue

2008-11-17 Thread Craige Leeder
Boyd, Todd M. wrote: Are you sure this isn't like Javascript's "getMonth" function? Its index may begin at 0, making "day 0" the "first day" of the year. HTH, Todd Boyd Web Programmer Hmm, though I know us programmers love to start counting at zero, why would something as static as a da

Re: [PHP] Date Issue

2008-11-17 Thread Nathan Rixham
Boyd, Todd M. wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 10:50 AM To: php-general@lists.php.net Subject: [PHP] Date Issue $smont = 10; $sday = 13; $syear = 2008; $timestamp = mktime(0,0,0,$smont,$sday,$syear); $thismonth =

RE: [PHP] Date Issue

2008-11-17 Thread Boyd, Todd M.
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Monday, November 17, 2008 10:50 AM > To: php-general@lists.php.net > Subject: [PHP] Date Issue > > $smont = 10; > $sday = 13; > $syear = 2008; > $timestamp = mktime(0,0,0,$smont,$sday,$syear); > $thismonth = g

Re: [PHP] Date Issue

2008-04-01 Thread Richard Lynch
If you want the DAY before, you can use the -1 for the day, and get what you want. mktime() will "wrap" the month as needed. But, yeah, if you try to hit a MONTH before by putting in a month before AND the day, it will "slingshot" back and forth to get what you don't want. If you want the MONTH

Re: [PHP] Date Issue

2008-04-01 Thread admin
Your doing the same thing i did look at date(d) When its the 31 like yesteday of course it can not find the 31 of months that do not have them. Thats why it errored. String worked up till monday which explained alot. I just did not look at what i was doing. changed the code to $zomonth =

Re: [PHP] Date Issue

2008-04-01 Thread Richard Lynch
I generally use 1 hour after midnight with mktime() to avoid the edge cases of daylight savings etc... mktime(1, 0, 0, date('m') - 1, date('d'), date('Y')); You also have to consider that you *COULD* call this right on the cusp of midnight, and the call to date('d') could happen one day, and the

Re: [PHP] Date Issue

2008-03-31 Thread Daniel Brown
On Mon, Mar 31, 2008 at 4:24 PM, <[EMAIL PROTECTED]> wrote: > Thank you again Dan. Thought never crossed my mind the day being the 31st. > That fixed it. Thank Andrew Ballard, actually. He said it even before I did. I'm getting slow in my old age! ;-P -- Forensic Services, Senior U

Re: [PHP] Date Issue

2008-03-31 Thread Andrew Ballard
On Mon, Mar 31, 2008 at 4:15 PM, <[EMAIL PROTECTED]> wrote: > I tried that a big no go. > Seems if I do a +1 i get 2 months from now and a -1 gives me the current > month. > > > $month = date("F", mktime(0,0,0, date('m'), date('d'), date('Y'))); > $zomonth = date("F", mktime(0,0,0, date("m")-1

Re: [PHP] Date Issue

2008-03-31 Thread admin
Thank you again Dan. Thought never crossed my mind the day being the 31st. That fixed it. Richard L. Buskirk On Mon, Mar 31, 2008 at 4:15 PM, <[EMAIL PROTECTED]> wrote: > I tried that a big no go. > Seems if I do a +1 i get 2 months from now and a -1 gives me the current month.

Re: [PHP] Date Issue

2008-03-31 Thread Andrew Ballard
On Mon, Mar 31, 2008 at 4:15 PM, <[EMAIL PROTECTED]> wrote: > I tried that a big no go. > Seems if I do a +1 i get 2 months from now and a -1 gives me the current > month. Like I said, mktime makes corrections for otherwise invalid dates. Today is March 31. Moving the month number back by one (

Re: [PHP] Date Issue

2008-03-31 Thread Dan Joseph
On Mon, Mar 31, 2008 at 3:15 PM, <[EMAIL PROTECTED]> wrote: > I tried that a big no go. > Seems if I do a +1 i get 2 months from now and a -1 gives me the current > month. > > > $month = date("F", mktime(0,0,0, date('m'), date('d'), date('Y'))); > $zomonth = date("F", mktime(0,0,0, date("m")-1, da

Re: [PHP] Date Issue

2008-03-31 Thread Daniel Brown
On Mon, Mar 31, 2008 at 4:15 PM, <[EMAIL PROTECTED]> wrote: > I tried that a big no go. > Seems if I do a +1 i get 2 months from now and a -1 gives me the current > month. > > > > $month = date("F", mktime(0,0,0, date('m'), date('d'), date('Y'))); > $zomonth = date("F", mktime(0,0,0, date("m")

Re: [PHP] Date Issue

2008-03-31 Thread admin
I tried that a big no go. Seems if I do a +1 i get 2 months from now and a -1 gives me the current month. $month = date("F", mktime(0,0,0, date('m'), date('d'), date('Y'))); $zomonth = date("F", mktime(0,0,0, date("m")-1, date("d"), date("Y"))); $nmonth = date("F", mktime(0,0,0, date(m)+1, date(d

Re: [PHP] Date Issue

2008-03-31 Thread Richard Lynch
You need apostrophes (or quotes) around your args to date() in the parameters... date('m') As it stands now, PHP assumes you mean the constant m (http://php.net/define) and that's not defined, so they are all 0. So you are passing in 0 to ALL the args. You also should use E_ALL for your error_r

Re: [PHP] Date Issue

2008-03-31 Thread Andrew Ballard
On Mon, Mar 31, 2008 at 3:07 PM, <[EMAIL PROTECTED]> wrote: > Not understanding why this is happening. > > $month = date("F", mktime(0,0,0, date(m), date(d), date(Y))); > $zomonth = date("F", mktime(0,0,0, date(m)-1, date(d), date(Y))); > > echoing out the exact same month > March > March > >