Could probably be simplified; but this is the first thing I came up with that worked:
function second_wednesday($timestamp)
{
list($year,$month,$date)=explode(':',date('Y:n:j',$timestamp));
$second_wednesday = strtotime('2nd Wednesday', mktime(0,0,0,$month,1,$year));
if($second_wednesday<mktime(0,0,0,$month,$date,$year)) // Try next month (Maybe you'll want "<=", here)
$second_wednesday = second_wednesday(mktime(0,0,0,$month+1,1,$year));
return $second_wednesday;
}
$timestamp = mktime(0,0,0,10,24,2004);
$second_wednesday = second_wednesday($timestamp);
echo date('Y-m-d',$second_wednesday);