Location: PHPKode > projects > News Manager - RSS aggregator > newsmanager/date_format.php
<?php
	/*******************************************************************************
     **  File          :  date.php                                                **
     **  Author        :  G.Ramkumar                                              **
     **  Description   :  changing the date as dd/mm/yyyy format			      **
  	 **  Date          :  14/07/2005                                              **
     **  Last Modified :  02/08/2005                                              **
     **  PHP Version   :  5.0.3                                                   **
     **                                                                           **
     *******************************************************************************/

		if(!strstr($date,",") && strstr($date,"-")){
		  $date=explode("-",$date);
          $pubdate=substr($date[2],0,2)."/".$date[1]."/".$date[0];
          $yesterday = strftime ("%d/%m/%Y", strtotime("-1 day"));
		  $today=date('d/m/Y');

          if($pubdate == $today)
           $pubdate="Today";
          elseif($pubdate == $yesterday)
		    $pubdate="Yesterday";
		  else
			$pubdate=$pubdate;
		}elseif(strstr($date,",")){
            preg_match("/(\,)(.*?)(\:)/i",$date,$match);
            $exdate=explode(" ",trim($match[2]));

            $month=get_month($exdate[1]);
            $pubdate=$exdate[0]."/".$month."/".$exdate[2];
		}else
		  $pubdate=$date;

?>
Return current item: News Manager - RSS aggregator