| CallXML 3.0 Development Guide | Home | Frameset Home |
|
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="3.0">
<do>
</do>
</callxml>
<do>
<cfset TodaysDate = Now()>
Now() function. Now we will want to parse that variable and output some text to the caller via the callxml text-to-speech element.
<cfoutput>
<say>
</say>
</cfoutput>
<say> tags because we want to read the information that is being output.
<cfif #DatePart("h", TodaysDate)# less than 10>
oh
#Datepart("h", TodaysDate)#
hundred hours
and
#DatePart("n", TodaysDate)#
minutes.
<cfelse>
#DatePart("h", TodaysDate)#
hundred hours and
#DatePart("n", TodaysDate)#
minutes.
</cfif>
The date is
#DayofWeekAsString(DayOfWeek(TodaysDate))#,
#MonthAsString(Month(TodaysDate))#,
#Day(TodaysDate)#
#DatePart("yyyy", TodaysDate)#.
There are
#DaysInMonth(TodaysDate)#
days in this month.
We are in week
#Week(TodaysDate)#
of the year
#Year(TodaysDate)#
<cfset DaysLeft = #DaysinYear(TodaysDate)# -
#DayofYear(TodaysDate)#>
There are
#DaysLeft#
days left in this year.
</do>
</callxml>
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="3.0">
<do>
<cfset TodaysDate = Now()>
<cfoutput>
<say>
<cfif #DatePart("h", TodaysDate)# less than 10>
oh #Datepart("h", TodaysDate)# hundred hours and
#DatePart("n", TodaysDate)# minutes.
<cfelse>
#DatePart("h", TodaysDate)# hundred hours and
#DatePart("n", TodaysDate)# minutes.
</cfif>
The date is #DayofWeekAsString(DayOfWeek(TodaysDate))#,
#MonthAsString(Month(TodaysDate))#, #Day(TodaysDate)#
#DatePart("yyyy", TodaysDate)#.
There are #DaysInMonth(TodaysDate)# days in this month.
We are in week #Week(TodaysDate)# of the year
#Year(TodaysDate)#.
<cfset DaysLeft = #DaysinYear(TodaysDate)# -
#DayofYear(TodaysDate)#>
There are #DaysLeft# days left in this year.
</say>
</cfoutput>
</do>
</callxml>
| ANNOTATIONS: EXISTING POSTS |
| login |
|