triexa — 2010-03-09T08:35:34-05:00 — #1
So I discovered the wonders of DateTime and DateTimeZone but must have overlooked one critical problem - I cannot see how to use the current locale to format a timestamp!
For example, today I would like to say its "Mars" (french), not "March".
How can I do that with these classes?
unwrittenphp — 2010-03-09T09:00:24-05:00 — #2
As far as I know PHP's DateTime object only supports English.
triexa — 2010-03-09T09:07:23-05:00 — #3
It's unfortunate that it feels like a lot of these new objects we have are taking a step backwards (or at least, not forwards) in many aspects
raju_gautam — 2010-03-09T10:19:54-05:00 — #4
If you are in windows then there are different strings for setting setlocale. Like following does works:
echo strftime("%A %B"); // prints mardi mars
You will find windows setlocale strings as follows: