[asterisk-dev] ast_ variant of strptime

Johan Wilfer johan at wilfer.se
Thu Oct 18 22:12:33 CDT 2007


I've a workaround for this bug that I've been using.
As long you are creating date/times for the current day this AEL code works.


//Check if STRPTIME make an error in calculation
Set(nowcalc=${STRPTIME(${STRFTIME(${now},${tz},%Y-%m-%d
%H:%M:%S)},${tz},%Y-%m-%d %H:%M:%S)});
Set(strptime_calcoffset=$[${now}-${nowcalc}]);
if (${strptime_calcoffset} != 0) { Noop(STRPTIME calculates wrong with
${strptime_calcoffset} seconds - adjusting.); }

Then I just adds the ${strptime_calcoffset} on all STRPTIME created epochs...

Good luck!
/Johan Wilfer


2007/10/19, Dan Austin <Dan_Austin at phoenix.com>:
> I'm working on adding a feature to allow a caller
> to extend a RealTime scheduled conference by a
> configurable amount using *5, which appears to
> be the only open option in the admin menu.
>
> The code is functional, but I see  problem were
> the results in an error of exactly 1 hour (similar
> to bug id 10531).
>
> I tried to model the code based on strptime in
> funcs/func_strings, and all of this is using
> trunk from yesterday.
>
> Bug id 10531 seems to indicate the issue is resolved,
> but the coincidence is too high.
>
> Any tips, pointers or thoughts on what I should try
> to tackle to correct the error?
>
> Dan
>
>
>
>
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>



More information about the asterisk-dev mailing list