We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics
determining date and time
determining date and time
I need to change the action in a vxml application based on time of day and day of the week. Is there a way to pickup these values from within the vxml application?
Re: determining date and time
Hi moose155,
The following IVR code example should help you pick up the day of the week and (universal) time of of day.
dateandtime.php
You can also use the following link as reference for Date objects: http://www.w3schools.com/jsref/jsref_obj_date.asp
Regards,
Plum Support
The following IVR code example should help you pick up the day of the week and (universal) time of of day.
dateandtime.php
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<form>
<script>
var currentDate = new Date();
var month = currentDate.getMonth() + 1;
var day = currentDate.getDate();
var year = currentDate.getFullYear();
currentDate = month + "/" + day + "/" + year;
var currentTime = new Date();
var hour = currentTime.getUTCHours();
var minute = currentTime.getUTCMinutes();
</script>
<block>
<prompt>
The date is <value expr="currentDate"/>. The universal time is <value expr="hour"/> hours and <value expr="minute"/> minutes.
</prompt>
</block>
</form>
</vxml>
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com