[wp-hackers] question on mysql2date

David Clark david at davidsaccess.com
Sat Oct 2 15:29:49 UTC 2004


Hi,

I have a function to display the human readable version of $m, which is 
the heading of a directory listing. The code is:
function archive_header_mo($month, $before='', $after='') {
      global $lmonth, $post, $m;
	   if ($month != $lmonth)
        {  $output = mysql2date("F",$post->post_date);
        if ('' != mysql2date("d",$m))
            {$output .= mysql2date("d",$m);}
       $output .= ', '.mysql2date("Y",$post->post_date);
              $output .= '<a 
href="'.get_month_link(mysql2date("Y",$post->post_date), 
mysql2date("m",$post->post_date)) .'">+</a>';
                 $output = $before.$output.$after.NL;
           $lmonth = $month;
        }
       echo $output;
}

The problem I am having is that when $m does not have a day, as in 
200404, it returns "April31, 2004" and not the "April, 2004" I want and 
expect.

I know I am missing something basic, just don't know what it is

thanks,

dc




More information about the hackers mailing list