NYCPHP Meetup

NYPHP.org

[nycphp-talk] Run PHP on ASP page

David Mintz dmintz at davidmintz.org
Fri Jun 25 12:08:42 EDT 2004


On Fri, 25 Jun 2004, inforequest wrote:

> <snip />
>
> Is this good for the next round of advertising?
>
> New York PHP
> PHP training, talk lists, and
> wise ass AMP bigots. Free!
> http://www.nyphp.org


I say it's time for a new acronym: WAAMPB

----
David Mintz, Just Another WAAMPB
http://davidmintz.org/

        "Anybody else got a problem with Webistics?" -- Sopranos 24:17

>From hans not junk at nyphp.com  Fri Jun 25 12:11:30 2004
Return-Path: <hans not junk at nyphp.com>
Received: from smtp11.intermedia.net (smtp11.intermedia.net [64.78.21.10])
	by virtu.nyphp.org (Postfix) with ESMTP id C144FA85F3
	for <talk at lists.nyphp.org>; Fri, 25 Jun 2004 12:11:29 -0400 (EDT)
Received: from ehost011-1.intermedia.net ([64.78.21.3]) by
	smtp11.intermedia.net with Microsoft SMTPSVC(6.0.3790.0); 
	Fri, 25 Jun 2004 09:03:30 -0700
X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C45ACF.121E0A8A"
Date: Fri, 25 Jun 2004 09:11:26 -0700
Message-ID: <41EE526EC2D3C74286415780D3BA9F8702C53EBE at ehost011-1.exch011.intermedia.net>
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator: 
Thread-Topic: Recurring Monthly Calculations
Thread-Index: AcRazxFVw60YmEWDT2WHuALaTH8CjA==
From: "Hans Zaunere" <hans not junk at nyphp.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
X-OriginalArrivalTime: 25 Jun 2004 16:03:30.0088 (UTC)
	FILETIME=[F5256280:01C45ACD]
Subject: [nycphp-talk] Recurring Monthly Calculations
X-BeenThere: talk at lists.nyphp.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: NYPHP Talk <talk at lists.nyphp.org>
List-Id: NYPHP Talk <talk.lists.nyphp.org>
List-Unsubscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=unsubscribe>
List-Archive: <http://lists.nyphp.org/pipermail/talk>
List-Post: <mailto:talk at lists.nyphp.org>
List-Help: <mailto:talk-request at lists.nyphp.org?subject=help>
List-Subscribe: <http://lists.nyphp.org/mailman/listinfo/talk>,
	<mailto:talk-request at lists.nyphp.org?subject=subscribe>
X-List-Received-Date: Fri, 25 Jun 2004 16:11:30 -0000

This is a multi-part message in MIME format.

------_=_NextPart_001_01C45ACF.121E0A8A
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable


Hey all,

I needed to write a function that will tell me the dates of future
events that recurr monthly by day of month.  So for instance, "4th
Tuesday of the month for the next 6 months"

It ended up to be more difficult than I thought and I wanted to run the
function past you guys.  See attached.  Am I missing some clever way of
doing this?  The function seems to work, but another set of eyes would
be helpful - and it depends on UNIX timestamps, so...

The function is called as:

recurMonthlyByDay(2,4,20030522,23);

Which would return an array listing the 4th Tuesday, starting in May of
2003, for the next 23 months.  If you specify the second argument to be
greater than 5, then the last Tuesday would always be returned.


Thanks guys... feel free to use the function, too (that is, if it works)

H



------_=_NextPart_001_01C45ACF.121E0A8A
Content-Type: application/octet-stream;
	name="RecurMonthlyByDay.inc"
Content-Transfer-Encoding: base64
Content-Description: RecurMonthlyByDay.inc
Content-Disposition: attachment;
	filename="RecurMonthlyByDay.inc"

CmZ1bmN0aW9uIFJlY3VyTW9udGhseUJ5RGF5KCAkcmVjdXJvbiwkcmVjdXJhdCwkc3RhcnRhdCA9
IE5VTEwsJGNvdW50ID0gTlVMTCApIHsKCiAgIGlmKCAhJHN0YXJ0YXQgKQogICAgICAkc3RhcnRh
dCA9IChpbnQpIGRhdGUoJ1ltZCcpOwoKICAgJFkgPSAoaW50KSBmbG9vcigkc3RhcnRhdC8xMDAw
MCk7CiAgICRNID0gKGludCkgZmxvb3IoKCRzdGFydGF0LSgkWSoxMDAwMCkpLzEwMCk7CgogICBp
ZiggISRjb3VudCApCiAgICAgICRjb3VudCA9IDE7CgogICBmb3IoICRpID0gMCwkcmVjdXJzID0g
YXJyYXkoKTsgJGkgPCAkY291bnQ7ICsrJGkgKSB7CgogICAgICAkWU1EID0gKCRZKjEwMDAwKSso
JE0qMTAwKSsxOwoKICAgICAgJHltZHRzID0gc3RydG90aW1lKCRZTUQpOwoKICAgICAgJGZpcnN0
b2Ztb250aCA9IChpbnQpIGRhdGUoJ3cnLCR5bWR0cyk7CiAgICAgICRkYXlzaW5tb250aCA9IChp
bnQpIGRhdGUoJ3QnLCR5bWR0cyk7CiAgICAgICRyZWN1cnNbJGldID0gKCRyZWN1cm9uLSRmaXJz
dG9mbW9udGgpICsgMTsKICAgICAgaWYoICRyZWN1cnNbJGldIDw9IDAgKQogICAgICAgICAkcmVj
dXJzWyRpXSArPSA3OwoKICAgICAgZm9yKCAkaiA9IDE7ICgkcmVjdXJzWyRpXSA8PSAkZGF5c2lu
bW9udGgpICYmICgkaiA8ICRyZWN1cmF0KTsgKyskaiApCiAgICAgICAgICRyZWN1cnNbJGldICs9
IDc7CgogICAgICBpZiggJHJlY3VyYXQgPiA1ICkKICAgICAgICAgJHJlY3Vyc1skaV0gLT0gNzsK
CiAgICAgIGlmKCAkcmVjdXJzWyRpXSA+ICRkYXlzaW5tb250aCApCiAgICAgICAgICRyZWN1cnNb
JGldID0gTlVMTDsKICAgICAgZWxzZQogICAgICAgICAkcmVjdXJzWyRpXSArPSAkWU1ELTE7Cgog
ICAgICBpZiggKyskTSA+IDEyICkgewogICAgICAgICAkTSA9IDE7CiAgICAgICAgICsrJFk7CiAg
ICAgIH0KICAgfQoKICAgcmV0dXJuICRyZWN1cnM7Cn0KCgo=

------_=_NextPart_001_01C45ACF.121E0A8A--



More information about the talk mailing list