RE: [PEAR] Calendar_Day is Sunday?
| From: | Mike Carter | Date: | Thu, 12 Feb 2004 15:51:59 +0000 |
| Subject: | RE: [PEAR] Calendar_Day is Sunday? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-10650@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Stefan Neufeind [mailto:Neufeind@speedpartner.de]
> Sent: 12 February 2004 15:48
>
> On 12 Feb 2004 at 15:39, Michael Wallner wrote:
>
> > is there a neat short way, I don't know of,
> > to determine if a Calendar_Day is a Sunday?
>
> Make timestamp from your date using mktime() and then feed that into
> getdate. Will give you also "wday" (weekday) where 0 represents a
> Sunday.
What if the timestamp is before 1970 though (such as a date of birth)? This
will just go all bad due to random definition of what happens before 1970
with unix timestamps. Is it not possible to use something from the
PEAR::Date class to avoid this?
- Mike C
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________