Skip to main content
Known Participant
January 14, 2010
Answered

Auto Date on Save

  • January 14, 2010
  • 1 reply
  • 480 views

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!

    This topic has been closed for replies.
    Correct answer Owainnorth

    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.

    1 reply

    Owainnorth
    OwainnorthCorrect answer
    Inspiring
    January 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.