Re: Problem with date('w')
| From: | BEOI 7308 | Date: | Tue, 26 Aug 2003 06:55:50 +0000 |
| Subject: | Re: Problem with date('w') | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-160731@lists.php.net to get a copy of this message | ||
i found out that using strtotime did the trick !!
<?
strtotime($theday);
$theday = date("Y-m-d", time());
echo date((w), $theday);
?>
> > I have a problem with the date function
> >
> > <?
> > $theday = date("Y-m-d", time());
> > echo date((w), $theday);
> > ?>
>
> I'm pretty sure the optional second argument for date is a unix timestamp
> that you would generate by using either time or mktime or strtotime. You
> are passing it something in the form of Y-m-d, or 2003-08-23 when it is
> expecting 1061852640.
> http://www.php.net/manual/en/function.date.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php