Re: [PHP] Re: Which function returns a correct ISO8601 date?

[email protected] (Simon Schick)
Newsgroups php.general
Message-ID <CAJWj5+Hn7-FHtoYB3zTjto25urekm6Z+2y30UYrGKRvf4UOopA@mail.gmail.com>
Hi, Alessandro

Would it be worth noting somewhere, that these two implementations of
ISO8601 differ? Because I needed the DateTime::ATOM way to save the
timezone ... Even so the other one was also about ISO 8601 ...

My system is working towards a search-engine called ElasticSearch.
This one makes use of a Java method to format a date. This one is
defined here:
http://joda-time.sourceforge.net/api-release/org/joda/time/format/ISODateTimeFormat.html#dateOptionalTimeParser%28%29

The definition for a time-offset is defined like this:
offset            = 'Z' | (('+' | '-') HH [':' mm [':' ss [('.' | ',') SSS]]])

Is there a format, you know of, that makes this difference (colon or
not) bullet-prove?
Bye,
Simon


On Sat, Sep 7, 2013 at 5:29 PM, Alessandro Pellizzari <[email protected]> wrote:
> On Sat, 07 Sep 2013 14:47:00 +0200, Simon Schick wrote:
>
>> The method date("c") actually formats a date, fitting to the format
>> defined in the constant DateTime::ATOM.
>>
>> Are both formats (with and without colon) valid for ISO8601, or is the
>> documentation for the method date() wrong?
>
> Yes:
>
> http://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators
>
> Bye.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.