[Asterisk-Dev] DATETIME Variable or TIME in general

Nicholas Romero nxn at idim.com
Mon Oct 6 10:25:37 MST 2003


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;







More information about the asterisk-dev mailing list