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
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
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
&
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
>
> -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
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
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
> -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,$smo
$smont = 10;
$sday = 13;
$syear = 2008;
$timestamp = mktime(0,0,0,$smont,$sday,$syear);
$thismonth = getdate($timestamp);
Here is where the problem comes into play.
echo $thismonth['yday'];
This displays 286 when in fact its 287.
Is there a problem in my ini file or what is the deal.
--
PHP Ge
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
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 =
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
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
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
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.
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 (
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
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")
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
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
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
>
>
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
Checked server timezone/date/time all is good. Am I half asleep at the wheel on
22 matches
Mail list logo