Display previous month

Display previous month

am 05.11.2007 13:22:07 von samhale

Hopefully an easy one. Can someone please supply me with the code for
displaying the previous month?
I do not want just -3 from December for October. It needs to work each
month without modifying.

Many thanks
Sam

Re: Display previous month

am 05.11.2007 13:57:44 von Jerry Stuckle

samhale@hotmail.com wrote:
> Hopefully an easy one. Can someone please supply me with the code for
> displaying the previous month?
> I do not want just -3 from December for October. It needs to work each
> month without modifying.
>
> Many thanks
> Sam
>
>

Sam,

I'm not sure what you're asking for. Can you clarify this a little more?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Display previous month

am 05.11.2007 14:13:39 von samhale

On 5 Nov, 12:57, Jerry Stuckle wrote:
> samh...@hotmail.com wrote:
> > Hopefully an easy one. Can someone please supply me with the code for
> > displaying the previous month?
> > I do not want just -3 from December for October. It needs to work each
> > month without modifying.
>
> > Many thanks
> > Sam
>
> Sam,
>
> I'm not sure what you're asking for. Can you clarify this a little more?
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

Jerry,

I am looking for a simple piece of PHP code that will write the
previous month in full.
So for example, if it was used now, it would display the text
'October'.
If it was used in April, it would display 'March', etc.
Sorry I wasn't very clear.

Thanks
Sam

Re: Display previous month

am 05.11.2007 15:37:41 von Jerry Stuckle

samhale@hotmail.com wrote:
> On 5 Nov, 12:57, Jerry Stuckle wrote:
>> samh...@hotmail.com wrote:
>>> Hopefully an easy one. Can someone please supply me with the code for
>>> displaying the previous month?
>>> I do not want just -3 from December for October. It needs to work each
>>> month without modifying.
>>> Many thanks
>>> Sam
>> Sam,
>>
>> I'm not sure what you're asking for. Can you clarify this a little more?
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstuck...@attglobal.net
>> ==================
>
> Jerry,
>
> I am looking for a simple piece of PHP code that will write the
> previous month in full.
> So for example, if it was used now, it would display the text
> 'October'.
> If it was used in April, it would display 'March', etc.
> Sorry I wasn't very clear.
>
> Thanks
> Sam
>
>

OK, maybe something like:

echo date("F",strtotime("-1 month"));

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Display previous month

am 05.11.2007 15:42:13 von Jerry Stuckle

samhale@hotmail.com wrote:
> On 5 Nov, 12:57, Jerry Stuckle wrote:
>> samh...@hotmail.com wrote:
>>> Hopefully an easy one. Can someone please supply me with the code for
>>> displaying the previous month?
>>> I do not want just -3 from December for October. It needs to work each
>>> month without modifying.
>>> Many thanks
>>> Sam
>> Sam,
>>
>> I'm not sure what you're asking for. Can you clarify this a little more?
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstuck...@attglobal.net
>> ==================
>
> Jerry,
>
> I am looking for a simple piece of PHP code that will write the
> previous month in full.
> So for example, if it was used now, it would display the text
> 'October'.
> If it was used in April, it would display 'March', etc.
> Sorry I wasn't very clear.
>
> Thanks
> Sam
>
>

Nope, that one fails on March 31st, for instance.

How about:

echo date("F",strtotime(-date('j') . ' days'));

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Display previous month

am 05.11.2007 16:11:36 von samhale

On 5 Nov, 14:42, Jerry Stuckle wrote:
> samh...@hotmail.com wrote:
> > On 5 Nov, 12:57, Jerry Stuckle wrote:
> >> samh...@hotmail.com wrote:
> >>> Hopefully an easy one. Can someone please supply me with the code for
> >>> displaying the previous month?
> >>> I do not want just -3 from December for October. It needs to work each
> >>> month without modifying.
> >>> Many thanks
> >>> Sam
> >> Sam,
>
> >> I'm not sure what you're asking for. Can you clarify this a little more?
>
> >> --
> >> ==================
> >> Remove the "x" from my email address
> >> Jerry Stuckle
> >> JDS Computer Training Corp.
> >> jstuck...@attglobal.net
> >> ==================
>
> > Jerry,
>
> > I am looking for a simple piece of PHP code that will write the
> > previous month in full.
> > So for example, if it was used now, it would display the text
> > 'October'.
> > If it was used in April, it would display 'March', etc.
> > Sorry I wasn't very clear.
>
> > Thanks
> > Sam
>
> Nope, that one fails on March 31st, for instance.
>
> How about:
>
> echo date("F",strtotime(-date('j') . ' days'));
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================- Hide quoted text -
>
> - Show quoted text -

Seems to work fine. Many thanks for your help.

Re: Display previous month

am 06.11.2007 06:02:51 von AnrDaemon

Greetings, Jerry Stuckle.
In reply to Your message dated Monday, November 5, 2007, 17:42:13,

> echo date("F",strtotime(-date('j') . ' days'));

Another piece of ***:

date('F', mktime(1, 1, 1, date('m')-1, 1, date('Y')));

;)


--
Sincerely Yours, AnrDaemon

Re: Display previous month

am 06.11.2007 06:28:20 von Jerry Stuckle

AnrDaemon wrote:
> Greetings, Jerry Stuckle.
> In reply to Your message dated Monday, November 5, 2007, 17:42:13,
>
>> echo date("F",strtotime(-date('j') . ' days'));
>
> Another piece of ***:
>
> date('F', mktime(1, 1, 1, date('m')-1, 1, date('Y')));
>
> ;)
>
>

Yours fails in January.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Display previous month

am 06.11.2007 09:23:07 von frankO

On 5 nov, 13:22, samh...@hotmail.com wrote:
> Hopefully an easy one. Can someone please supply me with the code for
> displaying the previous month?
> I do not want just -3 from December for October. It needs to work each
> month without modifying.
>
> Many thanks
> Sam

The PHP manual gives some solutions. Maybe this one will work:
http://nl3.php.net/manual/nl/function.mktime.php#53662

Re: Display previous month

am 06.11.2007 12:23:06 von AnrDaemon

Greetings, Jerry Stuckle.
In reply to Your message dated Tuesday, November 6, 2007, 08:28:20,

> AnrDaemon wrote:
>> Greetings, Jerry Stuckle.
>> In reply to Your message dated Monday, November 5, 2007, 17:42:13,
>>
>>> echo date("F",strtotime(-date('j') . ' days'));
>>
>> Another piece of ***:
>>
>> date('F', mktime(1, 1, 1, date('m')-1, 1, date('Y')));
>>
>> ;)
>>
>>

> Yours fails in January.

Check it before posting such silliness.


echo date('D d F, Y', mktime(1, 1, 1, 0, 1, 2007));

?>

Intended answer:
Fri 01 December, 2006


--
Sincerely Yours, AnrDaemon

Re: Display previous month

am 06.11.2007 12:56:18 von Jerry Stuckle

AnrDaemon wrote:
> Greetings, Jerry Stuckle.
> In reply to Your message dated Tuesday, November 6, 2007, 08:28:20,
>
>> AnrDaemon wrote:
>>> Greetings, Jerry Stuckle.
>>> In reply to Your message dated Monday, November 5, 2007, 17:42:13,
>>>
>>>> echo date("F",strtotime(-date('j') . ' days'));
>>> Another piece of ***:
>>>
>>> date('F', mktime(1, 1, 1, date('m')-1, 1, date('Y')));
>>>
>>> ;)
>>>
>>>
>
>> Yours fails in January.
>
> Check it before posting such silliness.
>
> >
> echo date('D d F, Y', mktime(1, 1, 1, 0, 1, 2007));
>
> ?>
>
> Intended answer:
> Fri 01 December, 2006
>
>

Indeed, keep being an asshole. You're good at it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================