# DATE_ISO8601 and the "c" date() character

- Thread: https://externals.io/message/21747
- Original archive: https://news-web.php.net/php.internals/21747
- Started by Hannes Magnusson on 2006-01-31T21:37:16+00:00
- Messages: 3
- 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

---

## #21747 — Hannes Magnusson — 2006-01-31T21:37:16+00:00

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

Hi all

I just noticed that the DATE_ISO8601 constant and the "c" `date()`
character don't give the same results.
The difference is that the "c" format prints colon in the timezone
offset, but the constant does not - both are however ISO8601
compliant.

Is this intentional? If not, I'd want to change the constant rather
then "c", since the "c" format has been there since 5.0 but the
constant since 5.1.1.

Patch attached (and patch for phpdoc).
However! I think ISO8601 formats without the colon are more used..,
not sure if this should be changed at all....

- Hannes

---

## #21748 — Hannes Magnusson — 2006-01-31T21:41:38+00:00

URL: https://externals.io/message/21747#21748 · In reply to: #21747

Hmh. No. The patches weren't attached ;)


> Hi all
>
> I just noticed that the DATE_ISO8601 constant and the "c" `date()`
> character don't give the same results.
> The difference is that the "c" format prints colon in the timezone
> offset, but the constant does not - both are however ISO8601
> compliant.
>
> Is this intentional? If not, I'd want to change the constant rather
> then "c", since the "c" format has been there since 5.0 but the
> constant since 5.1.1.
>
> Patch attached (and patch for phpdoc).
> However! I think ISO8601 formats without the colon are more used..,
> not sure if this should be changed at all....
>
> - Hannes

---

## #21751 — Derick Rethans — 2006-02-01T08:34:45+00:00

URL: https://externals.io/message/21747#21751 · In reply to: #21747

> I just noticed that the DATE_ISO8601 constant and the "c" `date()`
> character don't give the same results.
> The difference is that the "c" format prints colon in the timezone
> offset, but the constant does not - both are however ISO8601
> compliant.

<snip>

> However! I think ISO8601 formats without the colon are more used..,
> not sure if this should be changed at all....

Indeed, I don't think we should change this. As long as it is properly 
documented of course.

regards,
Derick
-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org
