home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / src / ASP / last_modified.asp < prev    next >
Encoding:
Text File  |  2001-06-08  |  1.3 KB  |  39 lines

  1. <%
  2. '*******************************************************
  3. '*     ASP 101 Sample Code - http://www.asp101.com     *
  4. '*                                                     *
  5. '*   This code is made available as a service to our   *
  6. '*      visitors and is provided strictly for the      *
  7. '*               purpose of illustration.              *
  8. '*                                                     *
  9. '* Please direct all inquiries to webmaster@asp101.com *
  10. '*******************************************************
  11. %>
  12.  
  13. <%
  14. Dim objFSO
  15. Dim objFile
  16. Dim dateModified
  17.  
  18. ' Creates the object and assigns it to our variable.
  19. Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
  20.  
  21. ' Get access to the file
  22. Set objFile = objFSO.GetFile(Server.MapPath("modified.asp"))
  23.  
  24. ' Get last modified property
  25. dateModified = objFile.DateLastModified
  26.  
  27. ' You can format it as you like using the FormatDateTime command
  28. %>
  29. This file was modified on the date and time below:<BR>
  30.   You can write out the date as is...<BR>
  31.      <%= dateModified %>;<BR>
  32.   or format it as you like!<BR>
  33.      <%= FormatDateTime(dateModified, 1) %>; at <%= FormatDateTime(dateModified, 3) %><BR>
  34. <%
  35. ' Kill our objects
  36. Set objFile = Nothing
  37. Set objFSO = Nothing
  38. %>
  39.