determining date and time
Posted: Tue Jul 13, 2010 4:56 pm
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?
Welcome to the PlumVoice IVR Support Forum
https://support.plumvoice.com/
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>