[Asterisk-Dev] DATETIME Variable or TIME in general

Nicholas Romero nxn at idim.com
Tue Oct 7 08:12:50 MST 2003


Actually I thought about the app idea. It would be more flexible.  If I do
that what I will most likely add is something to pull the time from a
channel.  Most of the time, no pun, when I want to record an even it has to
do with the time in relation to the start or stop of an event on some
channel.  I would like it to exactly match those times and not just the
system clock.  This could be important later for CDRs and billing.  That is
just nit picking maybe. At that point I would also do date and time
differences and local timezone corrections.  For now I am just going to do
the ISOTIME addition because it is small and simple. Even though I would
like to actually change the DATETIME definition, there are probably people
using it the way that it is.

Cheers,
-Nicholas



----- Original Message ----- 
From: "Ben Miller" <bgmiller at nframe.com>
To: <asterisk-dev at lists.digium.com>
Sent: Tuesday, October 07, 2003 8:40 AM
Subject: RE: [Asterisk-Dev] DATETIME Variable or TIME in general


Yeah, I'm the victim that put the time in that fashion and probably
messed up the docs too.  However, Unless ISOTIME is going to fix it for
everyone, you might consider an app_time(VARIABLE,format) so that you
and others can change their minds and put the time in whatever format
they want.
Just a thought, cause I can vouch for the adage that you can't please
everyone. ;-)
Ben

-----Original Message-----
From: asterisk-dev-admin at lists.digium.com
[mailto:asterisk-dev-admin at lists.digium.com] On Behalf Of John Todd
Sent: Tuesday, October 07, 2003 1:54 AM
To: asterisk-dev at lists.digium.com
Subject: Re: [Asterisk-Dev] DATETIME Variable or TIME in general

>Which format _should_ be correct? Code or Readme.  Currently I have to
do
>AGI to fix this would prefer not to have to.  Any objections to
changing to
>non-punctuated ISO format of:
>
>YYYYMMDDTHHMMSSTZD
>   for today
>20031006T120234-0500
>
>And also adding a Standard Variable of something like ${ISOTIME} for
>everyone to use.  Would be very useful for many things including file
names
>and easy to parse!
>
>
>-Nicholas
>
>
>----------
>
>Readme Says this:
>
>${DATETIME} Current date time in the format: YYYY-MM-DD_HH:MM:SS
>
>Code says this:
>
>  } else if (c && !strcmp(var, "DATETIME")) {
>    thistime=time(NULL);
>    localtime_r(&thistime, &brokentime);
>    snprintf(workspace, workspacelen -1, "%02d%02d%04d-%02d:%02d:%02d",
>      brokentime.tm_mday,
>      brokentime.tm_mon+1,
>      brokentime.tm_year+1900,
>      brokentime.tm_hour,
>      brokentime.tm_min,
>      brokentime.tm_sec
>      );
>    *ret = workspace;

It doesn't seem like a big issue to create an ISOTIME string.  Why
don't you create the routine and submit it as a feature request to
the bugtracker (http://bugs.digium.com/)?  I, too, have been using an
AGI hack to get the time into the "correct" format, since ${DATETIME}
doesn't have a logical ordering to the values.

JT
_______________________________________________
Asterisk-Dev mailing list
Asterisk-Dev at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-dev


_______________________________________________
Asterisk-Dev mailing list
Asterisk-Dev at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list