Req #17060 [Com]: Request: localization of strtotime
| From: | RReverser at gmail dot com | Date: | Fri, 15 Oct 2010 04:46:41 +0000 |
| Subject: | Req #17060 [Com]: Request: localization of strtotime | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-155197@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=17060&edit=1
ID: 17060
Comment by: RReverser at gmail dot com
Reported by: giank at geginformatica dot it
Summary: Request: localization of strtotime
Status: Closed
Type: Feature/Change Request
Package: Feature/Change Request
Operating System: Red Hat 7.1
PHP Version: 4.2.0
Block user comment: N
New Comment:
I want to propose simple solution for this problem:
http://www.phpclasses.org/package/6551-PHP-Manipulating-with-localized-date-time-strings.html
Previous Comments:
------------------------------------------------------------------------
[2002-05-08 21:41:09] giank at geginformatica dot it
Bogus.
------------------------------------------------------------------------
[2002-05-07 10:02:12] giank at geginformatica dot it
I think behaving on locale could trigger compatibility problems.
------------------------------------------------------------------------
[2002-05-07 09:48:36] giank at geginformatica dot it
int strtotime ( string time [, int now])
is the actual function. As it gets even a complex input from the string
"time", I think it's difficult to emulate these functionality in a
localized fashion. However, much of the international users are
concerned about the output of the function. That could be modified
without such a difficulty. Here's a proposal
int strtotime ( string time [, int now] [, string ccode])
where the optional string "ccode" handles the localization request.
Giving IT the result will be in Italian, EN or US for plain English, DE
for German, FR for French and so on.
So when requesting a date string, outputting in French, the software
only has to know the country specific position of the substrings week,
month, day, year and the name of weeks and months in that language.
This could not work for other calendar dates, as chinese.
Submitting 10+ languages could be a matter of hours work, and backward
compatibility should not be an issue, as the parameter "ccode" is
optional. This could be a little step for the PHP source code, but a big
step for the PHP community worldwide.
------------------------------------------------------------------------
[2002-05-07 00:24:23] rasmus@php.net
Not silly, just not all that easy to do. Changed to feature request.
------------------------------------------------------------------------
[2002-05-06 22:36:16] giank at geginformatica dot it
As the function strtotime only returns dates using the english names for
the months and weeks, why not make it more customizable, making it
possible to return dates in other languages? As of now, it could be got
much much useful. Thanks in advance, and excuse me if this seems a silly
request.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=17060&edit=1