Locale-aware date parsing

php.internals

Alexander

22 years ago
Hi! I'm learning the date formatting and parsing functions in PHP and see that there are no locale-aware date parsing function (strptime) that is a pair for strftime. Are there reasons to not implement it? Is a patch welcome? Some info about it is here: http://www.google.com/search?q=strptime and http://www.opengroup.org/onlinepubs/007908799/xsh/strptime.html Thanks, Alex

Hartmut Holzgraefe

22 years ago
Alexander Netkachev wrote:
> Hi! > > I'm learning the date formatting and parsing functions in PHP and see > that there are no locale-aware date parsing function (strptime) that is > a pair for strftime. > Are there reasons to not implement it? Is a patch welcome?
Short question: is it available on all our major platforms?
> Some info about it is here: http://www.google.com/search?q=strptime > and http://www.opengroup.org/onlinepubs/007908799/xsh/strptime.html
I couldn't find it on msdn.microsoft.com so i guess their C library doesn't have it. We've already had problems with Microsofs strftime() not supporting all placeholders so i'm against adding it by default. A PECL extension would be fine though. PS: We have talked about including the strftime() implementation of the BSD C library into the PHP source to get rid of the platform dependant strftime() inconsistencies. Maybe it is about time to re-think this, add strptime() to the idea?
-- Hartmut Holzgraefe <hartmut@php.net>