Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Auto Date on Save

Explorer ,
Jan 13, 2010 Jan 13, 2010

A long time ago when working with PHP, I remembered that there was a code that

could be inserted to the page that when opened, changed, saved by someone, it would print "Last Updated:..."

How is this done in CF?

Thanks!

443
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Jan 14, 2010 Jan 14, 2010

Hi there

Do you mean the modified date of the page itself? If so, this'll do the job:

<cfdirectory action="list" directory="#getDirectoryFromPath(getCurrentTemplatePath())#" name="qFileInfo" filter="#ReReplace(CGI.script_name,"/","")#" />
<cfoutput>#
qFileInfo.dateLastModified#</cfoutput>

O.

Translate
Guide ,
Jan 14, 2010 Jan 14, 2010
LATEST

Hi there

Do you mean the modified date of the page itself? If so, this'll do the job:

<cfdirectory action="list" directory="#getDirectoryFromPath(getCurrentTemplatePath())#" name="qFileInfo" filter="#ReReplace(CGI.script_name,"/","")#" />
<cfoutput>#
qFileInfo.dateLastModified#</cfoutput>

O.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources