That actually answers another question I had, but I thought maybe it wasn't
relevant for you (millisecond resolution, also quite commonly what you get
from Java apps doing ISO8601).

It's really just a minor detail, as NTP kind of hides leap seconds most of
the time (because really, they're a pretty horrible hack), but technically
speaking, sometimes the second field can contain "60" -- i.e. the minute
contains 61 seconds.  There's one this year, in June.

So, depending on how your system implements leap seconds, you might see:

2015-06-30T23:59:60Z

And this should possibly (probably?) be accepted.

On Mon, May 4, 2015 at 8:28 AM, Dave Sag <[email protected]> wrote:

> Excellent point.  In our general use case we have no need for millisecond
> accuracy, but I don't see any harm in adding it.  I've requested it for the
> 1.0.1 release.
>
> https://github.com/westfieldlabs/datetime_helper/issues/13
>
> Thanks
>
> dave
>
> On Sunday, 3 May 2015 17:28:36 UTC+10, Simon Russell wrote:
>>
>> Nice work; I actually find myself just redoing this sort of thing over
>> and over.  My only query would be how it handles leap seconds -- your regex
>> seems to limit seconds to values 0-59.
>>
>> On Sun, May 3, 2015 at 12:26 PM, Dave Sag <[email protected]> wrote:
>>
>>> Hi Gang,
>>>
>>> This weekend I was able to push out one of the small utility projects
>>> I've been working on as an Open Source (Apache 2 license) gem, released via
>>> WestfieldLabs (where I work).
>>>
>>> See https://github.com/westfieldlabs/datetime_helper
>>>
>>> It provides a collection of useful utilities for projects that have to
>>> deal with dates, times, and time zones, with particular utility for Rails
>>> projects that enforce the use of Zulu Time.
>>>
>>> Features
>>>
>>>    1. A base method called is_zulu_time?,
>>>    2. An rspec matcher called be_zulu_time,
>>>    3. An ActiveModel validator called zulu_time, and
>>>    4. An ActiveModel::Serializer helper method called in_zulu_time.
>>>
>>> Each feature can be required individually so you can use the rspec
>>> matcher, ActiveModel validator, or ActiveModel::Serializer helper in
>>> isolation.
>>>
>>> I hope you find some use for it :-)
>>>
>>> Cheers
>>>
>>> Dave
>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ruby or Rails Oceania" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/rails-oceania.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby or Rails Oceania" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/rails-oceania.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rails-oceania.
For more options, visit https://groups.google.com/d/optout.

Reply via email to