• Hi guys, i have tgis code in my theme for date:

    [code]<span class="postedby">Data <?php the_time('F jS, Y') ?></span>[/code]

    how can i put the date in portuguese format?

Viewing 1 replies (of 1 total)
  • if you mean by a Portuguese format that the days and months are in Portuguese names then this might work…

    not tested, out of the blue…

    <?php
    function transformDate($date = date('w-d-n-Y'));
    
    	$dayN   = array('domingo', 'segunda-feira', 'terça-feira', 'quarta-feira', 'quinta-feira', 'sexta-feira', 'sábado');
    	$monthN = array('janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro');
    
        $dag=strftime("%w",strtotime($rij['datum']));
        $datumdag=strftime("%d",strtotime($rij['datum']));
        $maand=strftime("%n",strtotime($rij['datum']));
        $jaar=strftime("%Y",strtotime($rij['datum']));
    
        $dayName   = strftime("%w",strtotime($date));
        $dayNumber = strftime("%d",strtotime($date));
        $monthName = strftime("%n",strtotime($date));
        $Year      = strftime("%Y",strtotime($date)); 
    
        return $dayname." ".$dayNumber." ".$monthName." ".$year;
    }
    ?> 
    
    [code]<span class="postedby">Today is <? echo transformDate(); ?></span>[/code]
Viewing 1 replies (of 1 total)
  • The topic ‘Custom date’ is closed to new replies.