In Railo Express 4.2, DateTimeFormat method on database variable does not work

We have a ColdFusion web application (created by another organization) that we are trying to move to Railo Express v4.2 http://www.getrailo.org/ (on another Windows server).

So far, everything works except for DateTimeFormat or DateFormat methods when trying to format a date / time value retrieved from a database (SQL Server).

DateFormat (Now (), 'dddd, m / d / yyyy') works correctly in Railo, but a similar call to DateFormat on a variable retrieved from a datetime column in the database fails with an error message like:

"cannot convert value {ts '2014-12-11 14:08:21'} to datetime value"

It is possible that I do not have it properly configured in the data source in Railo or in the system configuration for Railo.

In ColdFusion Server, the "getMetadata" method for the variable containing the datetime value of the database returns "java.sql.Timestamp". In Railo, the getMetadata method returns "java.lang.String" for the same variable. In Railo, getMetadata for "Now ()" returns "railo.runtime.type.dt.DateTimeImpl".

When looking for this issue, the only entry I could find was a bug in the old version of Railo, which has since been fixed.

Can anyone suggest any configuration options I might need to configure in Railo or any troubleshooting steps I can take to investigate the possible causes of this issue?

============================================

In Railo:

<cfoutput> # session.LastLoginDate # </cfoutput> returns {ts '2014-12-12 11:11:10'}

<cfoutput> #dateFormat ("{ts '2014-12-12 11:11:10'}", 'dddd, m / d / yyyy') # </cfoutput> returns on Friday 12/12/2014

But (combining the two), <cfoutput> #dateFormat (session.LastLoginDate, 'dddd, m / d / yyyy') # </cfoutput> doesn't work with: Can't use String [{ts' 2014-12-12 11: 11:10 '}] for a value of type [datetime]

+3


source to share





All Articles