1
I am using processwire and to put the post creation date I used the following code
<?php echo ( date("F j, Y ", $page->created). "at " . date("g:i A", $page->created)); ?></p>
However this code does show the date in English format and I would like to translate to Portuguese
I’ll show you the change I made
<p><span class="glyphicon glyphicon-time"></span> Posted on <?php echo ( date("F j, Y ", $page->created). "at " . date("g:i A", $page->created)); //antes
//Alteração apartir daqui
// strftime("%A, %d de %B de %Y", strtotime( $page->created));
$en = ['','January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
$pt = [' de ', 'janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'];
echo("<br>");
echo str_replace($en, $pt, strftime("%d de %B de %Y as %H:%M", strtotime($date)));
?>
</p>
What was before September 2, 2015 at 10:31 AM
After amendment 1 January 1970 at 01:00
The dates are different
If anyone can add the processwire tag in the English stackoverflow already exists created
So you can’t change the locale?
– rray