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

David M. Lee dlee at digium.com
Wed Oct 16 13:11:53 CDT 2013


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

>> 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.

-- 
David M. Lee
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at:  www.digium.com  & www.asterisk.org




More information about the asterisk-app-dev mailing list