Format date in PHP

Asked

Viewed 695 times

4

I need to show date in PHP in the following format: "Sunday, December 9, 2014" ?

It’s got to be Bible time! If possible in Portuguese as well!



EDIT:

<?php 
setlocale( LC_ALL, 'pt_BR', 'pt_BR.iso-8859-1', 'pt_BR.utf-8', 'portuguese' ); 
date_default_timezone_set( 'America/Sao_Paulo' );
echo strftime( '%A, %d de %B de %Y', strtotime('today')); 
?>

detail is that the result is "Tuesday" and not "Tuesday", wanted to know how to take the fair, is possible ?

  • 2

    http://answall.com/questions/8317/como-fazer-a-fun%C3%A7%C3%A3o-date-formatar-uma-data-em-inglés%C3%Aas

  • Valew guy, I almost did everything with IF, it was going to be a huge code...Valew!!!

1 answer

5


here worked out.

<?php

setlocale(LC_ALL, "pt_BR", "pt_BR.iso-8859-1", "pt_BR.utf-8", "portuguese");
date_default_timezone_set("America/Sao_Paulo");
print strftime("%A, %d de %B de %Y");

?>

output

terça, 12 de agosto de 2014
  • Valew!!! that’s what I needed!!

  • detail is that the result is "Tuesday" and not "Tuesday", wanted to know how to take the fair, is possible ?

  • Funny, here it appears as Tuesday.... Vish

  • here appears Tuesday!!! I am using shaman as server!

  • ah, in this case, it goes to Gambi - $str = strftime("%A, %d of %B of %Y"); $str = str_replace("-feira","",$str);

  • worked out! Valew!!

  • Not Saturday and Sunday? or IF use ?

  • q probably not, but will have q wait kkk

  • ^^ ah, Valew!!!

Show 4 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.