[asterisk-app-dev] ARI timestamps in Unix format

Paul Belanger paul.belanger at polybeacon.com
Wed Oct 16 13:31:50 CDT 2013


On Wed, Oct 16, 2013 at 2:11 PM, David M. Lee <dlee at digium.com> wrote:
>
> On Oct 15, 2013, at 6:54 PM, Paul Belanger <paul.belanger at polybeacon.com> wrote:
>
>> On Tue, Oct 15, 2013 at 7:43 PM, Alistair Cunningham
>> <acunningham at integrics.com> wrote:
>>> Is there any chance we could have an option to use Unix timestamp format
>>> (seconds since 1970-01-01 00:00:00 ignoring leap seconds) in the ARI events
>>> (e.g. creationtime) and (if there are any) the actions?
>>>
>> Personally I'd like to see them as iso8601, mostly because other
>> RESTful APIs in work with use it.  I'd also like to see the default
>> timezone be UTC.
>
> Which is why we use ISO-8601 in ARI :-)
>
> Here's the strftime() format string: "%FT%T.%q%z"
>
> And here's an example: 2013-10-16T12:59:16.444-0500
>
+1

I haven't popped the format into python yet, but as long as most
languages accept the format as the default, I think we'll be fine with
it.  Looking at python I don't think there is an issue.

>>> I suspect (correct me if I'm wrong) that Asterisk uses Unix format
>>> internally, so for apps that do so too this would save some formatting and
>>> parsing on each end.
>>>
>>> I'd be perfectly happy to have this a setting in ari.conf that's disabled by
>>> default.
>>>
>> We already do a mix-mash thing with datetime within asterisk, some
>> modules implement GMT others don't. I'd vote for picking a standard
>> time then having the applications control it.
>
> ARI uses the default timezone within Asterisk, which (/me digs through
> code) looks like is whatever's in /etc/localtime.
>
> This format for timestamps is both readable and unambiguous. Those are
> two big wins, IMO.
>
Couldn't agree more.

-- 
Paul Belanger | PolyBeacon, Inc.
Jabber: paul.belanger at polybeacon.com | IRC: pabelanger (Freenode)
Github: https://github.com/pabelanger | Twitter: https://twitter.com/pabelanger



More information about the asterisk-app-dev mailing list