It looks like the double quotes is producing your problem. They work fine when mimicking the original double quotes, however, the date string did not originally have double quotes around it.
Try one of the versions below. (the second one simplifies the dynamic date to 2 calls instead of 6). var servertimestring=(servermode==""server-php"")? '""#dateformat(now(), 'MMMM')# #dateformat(now(), 'D')#, #dateformat(now(), 'YYYY')# #timeformat(now(), 'H')#:#timeformat(now(), 'mm')#:#timeformat(now(), 'ss')#""' : (servermode==""server-ssi"")? '<!--##config timefmt=""%B %d, %Y %H:%M:%S""--><!--##echo var=""DATE_LOCAL"" -->' : '<%= Now() %>' var servertimestring=(servermode==""server-php"")? '#dateformat(now(), 'MMMM D, YYYY')# #timeformat(now(), 'HH:mm:ss')#' : (servermode==""server-ssi"")? '<!--##config timefmt=""%B %d, %Y %H:%M:%S""--><!--##echo var=""DATE_LOCAL"" -->' : '<%= Now() %>' Hope this helps William -- William E. Seiter Web Developer http://William.Seiter.com -----Original Message----- From: Matthew Smith [mailto:[EMAIL PROTECTED] Sent: Saturday, September 29, 2007 3:01 PM To: CF-Talk Subject: php date to coldfusion date help I am trying to use a countdown timer I found on the web for an event countdown on one of our websites. Unfortunately, the script only comes setup for php and asp. I am trying to substitute coldfusion variables into the javascript instead of the php portion, but I am getting a NAN error from the script output. Here is the original line of code: var servertimestring=(servermode=="server-php")? '<? print date("F d, Y H:i:s", time())?>' : (servermode=="server-ssi")? '<!--#config timefmt="%B %d, %Y %H:%M:%S"--><!--#echo var="DATE_LOCAL" -->' : '<%= Now() %>' Here is what I came up with: var servertimestring=(servermode==""server-php"")? '""#dateformat(now(), 'MMMM')# #dateformat(now(), 'D')#, #dateformat(now(), 'YYYY')# #timeformat(now(), 'H')#:#timeformat(now(), 'mm')#:#timeformat(now(), 'ss')#""' : (servermode==""server-ssi"")? '<!--##config timefmt=""%B %d, %Y %H:%M:%S""--><!--##echo var=""DATE_LOCAL"" -->' : '<%= Now() %>' All the code is wrapped into a cfhtmlhead tag, which is why there are double quotes(""). If anyone out there understands php enough to help me with the formatting, that would be great. The countdown is for an event tommorrow night so I'm kind of pressed on this last minute request by the client. Thanks! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289809 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4