[thelist] ColdFusion confusion

Simon Perry thelist at si-designs.co.uk
Wed Jul 21 04:13:07 CDT 2004


Hi All,

I am trying to convert a application written in ColdFusion to PHP and 
PEAR::SOAP. The problems I have are...

No documentation for the WSDL service I'm connecting to, apart from the 
returned function list.

All the example code is in ColdFusion, a language I have zero knowledge of.

I'm nearly there apart from one function that requires a parameter to be 
sent back in "xsd:dateTime" format. I cannot make head nor tail of the 
ColdFusion code that does this. Can any of you ColdFusion Gurus tell me 
the format/datatype #fromdates# is returning in the following ColdFusion 
code?

TIA

Simon

<>Form code snippet (vd_toXxxx_xx is the same)
<select name=vd_fromDate_dd ><option value=01>01
<select name=vd_fromDate_mm > <option value=01 >Jan
<><select name=vd_fromDate_yyyy onchange(put2) ><option value=2004>2004
<select name=vd_fromTime_hh ><option value="00">00
<select name=vd_fromTime_mm > <option value=00>00
<><>
ColdFusion code
<cfset fromdate = 
"#form.vd_fromDate_dd#/#form.vd_fromDate_mm#/#form.vd_fromDate_yyyy#">
<cfset todate = 
"#form.vd_toDate_dd#/#form.vd_toDate_mm#/#form.vd_toDate_yyyy#">
<CFSET fromdateS = PARSEDATETIME(#fromdate#)>

<cfset fromdate1 = 
"#form.vd_fromDate_dd#-#month_yyyy#-#form.vd_fromDate_yyyy#">
<cfset todate2 = "#form.vd_toDate_dd#-#monthto_yyyy#-#form.vd_toDate_yyyy#">
<CFSET fromdateS = PARSEDATETIME('#fromdate1#')>
<CFSET comparison = DateCompare(fromdate1, todate2, "d")>
<CFSET comparison2 = DateCompare(Now(), fromdate1, "d")>
<cfif comparison2 eq 1 OR comparison eq 1 OR fromdate1 EQ todate2>
<table cellspacing="2" cellpadding="2" border="0" width="500" 
align="center">
<tr>
<td colspan="2" align="center"> <hr color="red"><font size="2" 
face="Arial">ERROR!</font></td>
</tr>
<tr>
<td colspan="2" align="center"><font color="Red" size="2" 
face="Arial">INVALID DATE</font></td>
</tr>
<tr>
<cfoutput> <td colspan="3" align="center" ><font size="2" color="000000" 
face="Arial">Please review your pick up date and drop off date<br> 
today's date is <font color="RED">#DATEFORMAT(NOW(),"DD/MM/YYYY")#-UK 
Time</font></font></strong><br></cfoutput><br><hr 
color="red"><br><br><br><br><br><br><br><br><br><br><br><br><br><br></td>
</tr>
</TABLE>
<cfabort>

</cfif>

<CFSET type = "d">
<CFSET fromdateS = PARSEDATETIME('#fromdate1#')>

<cfset numofdays = #Abs(DateDiff(type, fromdate1, todate2))#>

<cfset mytime1 = "#form.vd_fromTime_hh#.#form.vd_fromTime_mm#">
<cfset mytime2 = "#form.vd_toTime_hh#.#form.vd_toTime_mm#">
<cfset time = mytime2 - mytime1>
<cfif time gt 1>
<cfset numofdays = numofdays+1>
</cfif>
<cfset pickup_time = "#form.vd_fromTime_hh#:#form.vd_fromTime_mm#">
<cfset pickup_time = '#pickup_time#'>


More information about the thelist mailing list