"Translate" date returned in Portuguese to English

Asked

Viewed 159 times

0

Good night people!

I have a problem with a php script attached to phpbb cms, which returns the topics of certain forums and presents them in RSS 2.0 format.

The problem is that the date, while being processed by phpbb’s own method format_date, in the format "D, d M Y H:i:s O", is returned with the values of day and month in Portuguese, and I need these values in English, because the services I use end up bugging with the date in Portuguese.

I had seen in other questions here in the stack about the possibility of changing the locale to do such processing, but I have doubts about the effectiveness of this under the phpbb ecosystem.

An important detail is that the original data to be filtered by this method (variable $topic_date) is a UNIX timestamp, which means it can be used in another function, and that, according to the method documentation, I can use any format accepted by php’s date() function in the function format_date.

EDIT: In short:

The PHPBB can return me a timestamp or in the proper format of the RSS, but with the names in Portuguese:

<pubDate>Qui, 02 Out 2002 15:00:00 +0200</pubDate>

But I need it in English (because it duplicated services like twitterfeed), exactly in this format:

<pubDate>Wed, 02 Oct 2002 15:00:00 +0200</pubDate>

So there is a way to do this?

Grateful from now on.

  • 1

    You’re confused. Couldn’t you set it by the CMS of PHPBB? And another confusing point is that it is not clear whether it intends to translate from Portuguese to English or just change the visual format of the date to the ISO 8601 format, which many mistakenly attribute as "American format" or "English format". Therefore, be more objective by posting a practical example of how the date is currently and how it will look. Example "21-02-2016" wants it to look like "2016-02-21"?

  • I’m sorry about the confusion about this. You can not configure by PHPBB because then it changes to the whole forum, something that would not be very good in design. About the ISO 8601 format, well, it’s not exactly the php site and some other questions in the stack recommend. About the desired format, I will edit the question itself

No answers

Browser other questions tagged

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