[thelist] ColdFusion confusion

Seth Thomas Rasmussen seth at sethrasmussen.com
Wed Jul 21 12:38:43 CDT 2004


It would be a date/time value. ParseDateTime() takes string values, date
values, or a combination of the two to create a new date/time value which in
this case is assigned to #fromdateS#


-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org]On Behalf Of Simon Perry
Sent: Wednesday, July 21, 2004 4:13 AM
To: thelist at lists.evolt.org
Subject: [thelist] ColdFusion confusion


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#'>
--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !



More information about the thelist mailing list