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

Last Changed Code

Guest
Sep 26, 2006 Sep 26, 2006

Copy link to clipboard

Copied

If i use the lastchanged.cfm, it show up today date and time. If i use lastchanged.html it shows last changed date

The following code:
<script language="Javascript">
<!--
var default_date = "12/3/99"
var lm = document.lastModified

if (Date.parse(lm) == 0) {
lm = default_date
}

document.write("Last Modified on: " + lm + " EST")
//-->
</script>
TOPICS
Advanced techniques

Views

273

Translate

Translate

Report

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
Engaged ,
Sep 26, 2006 Sep 26, 2006

Copy link to clipboard

Copied

as cfm files are first processed by CF application server, it basically 'creates' a file that user sees in the browser, thus with cfm files lastModified will always be today.

Votes

Translate

Translate

Report

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
Guest
Sep 26, 2006 Sep 26, 2006

Copy link to clipboard

Copied

are there a way to use the last changed date from the DOS instead of CF creation date

Votes

Translate

Translate

Report

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
LEGEND ,
Sep 26, 2006 Sep 26, 2006

Copy link to clipboard

Copied

LATEST
here's one way
<CFDIRECTORY ACTION="LIST"
DIRECTORY="#GetDirectoryFromPath(GetBaseTemplatePath())#" NAME="latmod"
FILTER="#GetFileFromPath(GetBaseTemplatePath())#">
<CFOUTPUT><DIV ALIGN="CENTER" STYLE="font-size: 8pt;">Last Modified:
#DateFormat(latmod.DateLastModified, "mmmm d, yyyy")#
#TimeFormat(latmod.DateLastModified, "h:mm:ss tt")#</DIV></CFOUTPUT>

hth
--
Tim Carley
www.recfusion.com
info@NOSPAMINGrecfusion.com

Votes

Translate

Translate

Report

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
Documentation