Skip to main content
Participating Frequently
Aug 21, 2023 2:58 PM UTC
Question

dateformat not working after server upgrade

They dropped a servder upgrade on me and now (after a little more than 10 years) this code doesn't work.  Any ideas what I can change it to?

 

#dateformat(News_Date, 'dddd mmmm dd, yyyy')#

 

HELP!  Please,

 

And thank you.

This topic is closed to new replies. Start a new post to keep the conversation going.

26 replies

BKBK
Community Expert
Community Expert
Aug 26, 2023 9:42 AM UTC
quote

They dropped a servder upgrade on me and now (after a little more than 10 years) this code doesn't work.  Any ideas what I can change it to?

#dateformat(News_Date, 'dddd mmmm dd, yyyy')#

 

By @Monte28993316xw9z

 

Yes, here is an idea. Locate the line of code that contains 

 

dateformat(News_Date, 'dddd mmmm dd, yyyy')

 

Add the following validation code just before that line:

 

<cfset newsDateAsString=toString(News_Date)>
<cfif isDate(News_Date)>
	<cfset News_Date=parseDateTime(newsDateAsString)>
<cfelse>
	<cflog file="News_Date_Check" text="The value of the 'News_Date' variable is currently '#newsDateAsString#', which does not represent a valid date. Location: #getTemplatePath()#" type="error">	
	Sorry, error. The error has been logged. We're working on it.
	<cfabort>
</cfif>

 

If there is a wrong value for date, an error will be logged in News_Date_Check.log

 

Translate
Inspiring
Aug 26, 2023 9:35 PM UTC

 

they changed the way the DD or dd is ready its day in the year ( vs what it was i believe). he needs to patch the server or come up with another way to code that output not using CF. Everything is in the link I posted.

Translate
BKBK
Community Expert
Community Expert
Aug 27, 2023 12:49 PM UTC

@rickmaz , "dd" was used, instead of "DD", as @sdsinc_pmascari said. So I wonder whether patching the server is relevant. In any case, @Monte28993316xw9z mentioned being on CF10. 

 

@Monte28993316xw9z , are you really on CF10? Run the following as a test CFM page. What does it give you?

My ColdFusion version: <cfoutput>#server.coldfusion.productversion#</cfoutput>
Translate
Inspiring
Aug 21, 2023 3:51 PM UTC
Participating Frequently
Aug 21, 2023 3:57 PM UTC

So this is a server fix rather than a code change?

Translate
Community Expert
Aug 21, 2023 4:02 PM UTC

Yes, it's a server change.

 

Dave Watts, Eidolon LLC

Translate
Dave Watts, Eidolon LLC
Legend
Aug 21, 2023 3:09 PM UTC

What version of ColdFusion are you now running?  What is the exact error you are getting?
I just ran this on CFFiddle and it runs fine.

<cfset News_Date = now()>
<cfoutput>
#dateformat(News_Date, 'dddd mmmm dd, yyyy')#    
</cfoutput>
Translate
Participating Frequently
Aug 21, 2023 3:19 PM UTC

They offer fabulous error reporting...

The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.

You can see it in action here:
Northwest Association of Slot Track Enthusiasts : Results (naste.org)

I'm awaiting info on what version they are running.
Thank you very much.

Translate
Participating Frequently
Aug 21, 2023 3:21 PM UTC

A page will load without error with that line commented out:

http://www.naste.org/index.cfm 

Translate