We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

How to prompt the time in correct format

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
amitkhosla
Posts: 53
Joined: Sun Feb 15, 2009 11:42 pm
Contact:

How to prompt the time in correct format

Post 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

amitkhosla
Posts: 53
Joined: Sun Feb 15, 2009 11:42 pm
Contact:

Re: How to prompt the time in correct format

Post 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

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR code to prompt the time to the user

Post 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

Post Reply