|
Posted by kenrbnsn on 07/02/06 05:03
Joe wrote:
> My knowledge is poor, but I've been reading a bit and lurking for a
> while, and I wondered if it were possible to use PHP to display the date
> for the second Saturday in the current month, or if that has passed, the
> second Saturday for NEXT month.
You want to look at the time(), strtotime(), and date() functions.
Here is one way:
<?php
$today = time();
$sec_sat = (strtotime('2nd saturday this month') >
$today)?strtotime('2nd saturday this month'):strtotime('2nd saturday
next month');
echo date('l, F j, Y',$sec_sat);
?>
Ken
Navigation:
[Reply to this message]
|