[Asterisk-Dev] DATETIME Variable or TIME in general
Ben Miller
bgmiller at nframe.com
Tue Oct 7 06:40:28 MST 2003
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
More information about the asterisk-dev
mailing list