RE: [PHP] Problem with date('w')

2003-08-26 Thread Jennifer Goodie
 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



Re: [PHP] Problem with date('w')

2003-08-26 Thread BEOI 7308
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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Problem with date('w')

2003-08-25 Thread BEOI 7308
Hi

I have a problem with the date function

?
 $theday = date(Y-m-d, time());
  echo date((w), $theday);
?

should print 1 if today is monday, 2 if today is tuesday ...
though it's printing 4 and today is monday !

any idea ?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php