• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trying To Get File Date

 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm reading in a bunch of file descriptions with the pathname set up dynamically for the anchor tag. I want to create a column showing "Last Updated" for the files that are read in. How do I do that? All I can find is stuff related to reading in the lastmodified of the document, meaning the HTML document that is being processed at the time. I want to read the file lastmodified date from the file in the pathname in the anchor tag. Ex:

<a href="reports/reference/file.doc">Reference File</a>   Last Updated on May 22, 2006.
...next file
...next file

I have the full path, but I only load the relative path to the file. All I've been able to find is this:



Any help will be appreciated. Thanks.

Pat
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would have to use server side code since last modified only going to work with the current page and only if the server is set up correclty.

Eric
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, Eric, I just found some code (surprisingly) that seems to work ([URL=from http://www.getelementbyid.com/demo/LastModified/]from http://www.getelementbyid.com/demo/LastModified/[/url]):



Then somewhere in the body, here's the elements:


Granted, this only works well for IE, but in my workplace, that's all that's allowed. Thanks very much anyway. You're the first person to respond to any of my postings in a week!

The "o n l o a d" is actually one word, but it won't let me post as a single word.
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow. don't know why the code looks so small. And the URL surround didn't work right, so here's the uri:

www.getelementbyid.com/demo/LastModified/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic