user796443
user796443

Reputation:

How does set locale php work? and how can it work with php date?

I'm using this code: date("M j, Y", $end); to display date.

Problem is I've multilingual website, with wordpress + qtranslate.

Now M is problematic as it does not get translated. I read about setlocale php, anyone care explaining how this or if it would work at all?

Or maybe I should find some special qtrnaslate function that does this?

Upvotes: 1

Views: 2258

Answers (2)

Adam
Adam

Reputation: 6733

Wordpress has its own date formating function for international dates, date_i18n

Upvotes: 1

Mike B
Mike B

Reputation: 32145

From the manual on date()

http://php.net/manual/en/function.date.php

To format dates in other languages, you should use the setlocale() and strftime() functions instead of date().

Upvotes: 0

Related Questions