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! 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289800
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to