hello, I need to convert seconds into hh:mm:ss format, any hint ? T.
my hint : how / what are you trying to do this in ?? LUA, PHP, PERL, C# ? a little bit more info would help. J On Tue, Jun 1, 2010 at 9:41 PM, Tihomir Culjaga <tculjaga@gmail.com> wrote:
hello,
I need to convert seconds into hh:mm:ss format, any hint ?
T.
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Sincerely Jay
On Tue, Jun 1, 2010 at 1:49 PM, jay binks <jaybinks@gmail.com> wrote:
my hint : how / what are you trying to do this in ??
LUA, PHP, PERL, C# ?
a little bit more info would help.
J ahhh sorry, forgot to mention ..
im trying to do it in dialplan .... i have a channel variable holding the time e.g.: <action application="set" data="credit_time=405"/> <action application="phrase" data="timeleft,${credit_time}"/> phrase for timeleft expects hh:mm:ss time format .... any clue?
Tihomir, you can do that yourself with expr. h = expr floor(credit_time/3600) m = expr floor(mod(credit_time,3600)/60) s = expr mod(credit_time,60) Just convert that to the right $expr{} syntax. David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34 Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur. Le 01/06/2010 à 15:39, Tihomir Culjaga a écrit :
On Tue, Jun 1, 2010 at 1:49 PM, jay binks <jaybinks@gmail.com> wrote: my hint : how / what are you trying to do this in ??
LUA, PHP, PERL, C# ?
a little bit more info would help.
J ahhh sorry, forgot to mention ..
im trying to do it in dialplan ....
i have a channel variable holding the time
e.g.:
<action application="set" data="credit_time=405"/>
<action application="phrase" data="timeleft,${credit_time}"/>
phrase for timeleft expects hh:mm:ss time format ....
any clue?
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Tue, Jun 1, 2010 at 4:50 PM, David Ponzone <david.ponzone@gmail.com>wrote:
Tihomir,
you can do that yourself with expr.
h = expr floor(credit_time/3600) m = expr floor(mod(credit_time,3600)/60) s = expr mod(credit_time,60)
Just convert that to the right $expr{} syntax.
cool, it works: <action application="log" data="INFO TRANSFORM MINUTES=>>>> TIME=${expr(floor(405/3600))}:${expr(floor(mod(405,3600)/60))}:${expr(mod(405,60))}"/> Thanks!
On Wed, Jun 2, 2010 at 1:09 PM, Tihomir Culjaga <tculjaga@gmail.com> wrote:
On Tue, Jun 1, 2010 at 4:50 PM, David Ponzone <david.ponzone@gmail.com>wrote:
Tihomir,
you can do that yourself with expr.
h = expr floor(credit_time/3600) m = expr floor(mod(credit_time,3600)/60) s = expr mod(credit_time,60)
Just convert that to the right $expr{} syntax.
cool, it works:
<action application="log" data="INFO TRANSFORM MINUTES=>>>> TIME=${expr(floor(405/3600))}:${expr(floor(mod(405,3600)/60))}:${expr(mod(405,60))}"/>
Thanks!
and finally its like this: <macro name="timeleft_sec"> <input pattern="(\d+)"> <match> <action function="say" data="${expr(floor($1/3600))}:${expr(floor(mod($1,3600)/60))}:${expr(mod($1,60))}" method="pronounced" type="time_measurement"/> </match> </input> </macro>
participants (3)
-
David Ponzone
-
jay binks
-
Tihomir Culjaga