# Locale-aware date parsing

- Thread: https://externals.io/message/12148
- Original archive: https://news-web.php.net/php.internals/12148
- Started by Alexander Netkachev on 2004-08-13T10:09:28+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #12148 — Alexander Netkachev — 2004-08-13T10:09:28+00:00

URL: https://externals.io/message/12148#12148

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

---

## #12192 — Hartmut Holzgraefe — 2004-08-18T09:37:22+00:00

URL: https://externals.io/message/12148#12192 · In reply to: #12148

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
