Solved

What's the simplest way of obtaining/displaying a file's date of creation?

Posted on 2001-06-12
2
151 Views
Last Modified: 2013-12-24
Is there any way of reading/displaying a file's date of creation and/or date of uploading onto the server?
I realise there's the variable file.timecreated which is part of the <CFFILE> tag but I don't want to alter the file!  So is there any simple way of using the variable or accessing this information in some other way without altering my file?

Thanks in advance!
0
Comment
Question by:Tamalaine
2 Comments
 
LVL 4

Accepted Solution

by:
CF_Spike earned 50 total points
ID: 6181943
You can access the last modified date using the following:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
     <title>File Date</title>
</head>

<body>
<CFDIRECTORY ACTION="LIST"
        DIRECTORY="F:\sites\tests\wwwroot\CFFILE\"
        Name="thisdir">
<CFSET FileList = ValueList(thisdir.name)>
<CFSET DateList = ValueList(thisdir.datelastmodified)>
<CFSET FileToCheck = "index.cfm">
<CFSET FilePosition = ListFind(FileList,FileToCheck)>
<CFSET lastModifiedDate = ListGetAt(DateList,FilePosition)>
<CFSET TimeStamp = ParseDateTime(lastModifiedDate)>

<CFOUTPUT>
#TimeStamp#
</CFOUTPUT>


</body>
</html>

Spike
0
 

Author Comment

by:Tamalaine
ID: 6182123
Perfect!  Many thanks.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now