Page 1 of 1

How to prompt the time in correct format

Posted: Tue Apr 07, 2009 7:27 am
by amitkhosla
i have a requirement to prompt the time to the user. Like the time is 12 hours 15 mins.

what is the code to do that?

Regards & Thanks,
Amit

Re: How to prompt the time in correct format

Posted: Tue Apr 07, 2009 9:50 am
by amitkhosla
Please help me on this.

amitkhosla wrote:i have a requirement to prompt the time to the user. Like the time is 12 hours 15 mins.

what is the code to do that?

Regards & Thanks,
Amit

IVR code to prompt the time to the user

Posted: Tue Apr 07, 2009 11:21 am
by support
Hi,

Here is some IVR code using the IVR tag, <say-as>, that should help you with this:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
  <form>
    <script>
      var mytime = new Date();
      hours = mytime.getHours();
      minutes = mytime.getMinutes();
    </script>
    <block>
      <prompt>
        The time now is <value expr="hours"/> hours and <value expr="minutes"/> minutes.
      </prompt>
    </block>
  </form>
</vxml>
Hope this helps.

Regards,
Plum Support