How to remove Created Date of images and documents using .NET

Hi Aspose team,

We use v19.3 lib, but it can’t remove the Created Date of images and documents(doc, ppt, xls). Is this the expected behavior?

We checked the Created Date using the system file property > Details.

FYI, we can remove JpegExifInfo.DateTime, but we can still see the Created Date in Details.

@Glority_Developer,

The date/time that we set using DocMetadata.CreatedTime property can be viewed as Content created field under Origin section in the Windows Properties and it differs from the Date created field that is under File section (see screenshot). Furthermore, the DocMetadata.CreatedTime property can also be viewed if you open the documents (doc, ppt, xls) in MS Office (see screenshot). Similarly, the DocFormat.ClearBuiltinProperties() method removes the date fields that appear in the Origin section.

We have also logged it in our Issue Tracking System (as METADATANET-2837) to investigate the date fields that are appearing under File section in the Windows Properties for documents as well as for images. We shall keep you updated as soon as we have any information for you.

@Glority_Developer,

We have got the updates for you regarding the Ticket METADATANET-2837.

The Date created, Date modified and Date accessed properties (that appear under File section in the Windows Properties as well) of a file (image/document) have nothing to do with document’s content, instead, they are just common attributes of any file and folder stored in the file system. When you copy a file, the properties change, despite the fact, the content remains the same. That’s why it’s not included in the metadata properties that are attached to the document.

In case you still want to update these dates, you can easily do it using the standard classes of .NET framework (as shown in the following code snippets).

//File and FileInfo classes belong to the System.IO namespace
DateTime newValue = new DateTime(2085, 8, 15);
const string path = @"D:\test.docx";
File.SetCreationTime(path, newValue);
File.SetLastWriteTime(path, newValue);
File.SetLastAccessTime(path, newValue);
// OR
FileInfo fileInfo = new FileInfo(path);
fileInfo.CreationTime = newValue;
fileInfo.LastWriteTime = newValue;
fileInfo.LastAccessTime = newValue; 

Hope it helps.