Open In App

ASP DateCreated Property

The ASP DateCreated Property is used to return the date and time when the given file was created on the system.

Syntax:



The below examples demonstrate the ASP DateCreated Property.

Example 1: The below code demonstrates the ASP File.DateCreated Property.




<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
  
'Getting the file
set f=fs.GetFile("d:\GFG.txt")
Response.Write("File created on: ")
  
'Getting the date that the file was created
Response.Write(f.DateCreated)
set f=nothing
set fs=nothing
%>

Output:

File created on: 3/4/2020 10:07:20 AM

Example 2: The below code demonstrates the ASP Folder.DateCreated Property.




<%
dim fs,fol
set fs=Server.CreateObject("Scripting.FileSystemObject")
  
'Getting the folder
set fol=fs.GetFolder("d:\GFG")
Response.Write("This folder was created on: ")
  
'Getting the date when the folder was created
Response.Write(fol.DateCreated)
  
set fol=nothing
set fs=nothing
%>

Output:

This folder was created on: 12-03-2021 12:54:29 
Article Tags :