Tech / AI

How to Change Modified Date of a File

Online Tech Tips is reader-supported. We may earn a commission when you buy through links on our site. Learn more.
A clock and calendar icon behind the File Explorer icon

Your PC records the date you create, modify, and access all the files on your computer. The date and time information is tagged to your files and can be accessed by anyone. Changing these attributes before sharing a file can help cover your tracks. This article will show you how to change the modified date of a file on your Windows computer.

How to Change Modified Date of a File?

There are several ways to change a file’s attributes in Windows. You can use built-in tools (like Windows PowerShell and File Explorer) or third-party applications. This tutorial covers instructions on using PowerShell and File Explorer to change a file’s modified date in Windows. Our YouTube video below explains how to use third-party apps to change the date you modified a file.

Table of Contents

    Change File Attributes Using Windows PowerShell

    Modifying the original date(s) attributed to files using Windows PowerShell is straightforward. For this tutorial, we used PowerShell to change the last time/date we edited an Excel document. Here’s how:

    1. Copy the file’s location/directory to your computer’s clipboard. Right-click the file and select Copy as path.

    Steps to copy a file's path

    1. Press Windows key + X and select Terminal (Admin) in the Quick Link menu.

    "Terminal (Admin)" highlighted in Windows Quick Link menu Alternatively, type “powershell” in the Windows Search bar and select Run as Administrator in the Windows Powershell menu.

    Steps to run Windows PowerShell as an administrator in the Windows Start menu

    1. Paste the following command in the PowerShell terminal and hit Enter to change the date of creation:
    (Get-Item "file_path").CreationTime=("Day Month Year HH:MM:SS")

    Replace file_path with the file directory you copied in step #1 and the other attributes (Day, Month, Year, HH, MM, and SS) with your preferred value. HH, MM, and SS stand for hour, minute, and second, respectively.

    The resulting command for the sample document we’re modifying looks like this:

    (Get-Item "C:\Users\olanr\OneDrive\Desktop\Sample Report.xlsx").CreationTime=("21 May 2024 19:50:46")

    Steps to change files' Created date and time in PowerShell

    We successfully changed an Excel document’s creation date and time from “Monday, October 20, 2023, 4:35:41 AM” to “Tuesday, May 21, 2024, 7:50:46 PM.”

    An Excel document with two different "Created" creation time and date

    1. Paste the following in the terminal and hit Enter to change the file’s modified date:
    (Get-Item "file_path").LastWriteTime=("Day Month Year HH:MM:SS")

    Again, replace file_path with the file path you copied in step #1 and the other attributes (Day, Month, Year, HH, MM, and SS) with your preferred value. The command should look like the one below:

    (Get-Item "C:\Users\olanr\OneDrive\Desktop\Sample Report.xlsx").LastWriteTime=("26 May 2024 19:50:46")

    how to change date modified of a file in PowerShell

    That should change the file’s modification date immediately. Check the file properties to verify.

    1. To change a file’s date accessed value, paste the following in PowerShell and hit Enter:
    (Get-Item "file_path").LastAccessTime=("Day Month Year HH:MM:SS")

    Replace file_path with the file path you copied in step #1 and the other attributes (Day, Month, Year, HH, MM, and SS) with your preferred value. The command should look like the one below:

    (Get-Item "C:\Users\olanr\OneDrive\Desktop\Sample Report.xlsx").LastAccessTime=("30 May 2024 20:25:57")

    Steps to change a files' accessed date in PowerShell

    Windows will change the date accessed to the values provided in the command.

    Note: These commands permanently change a file’s “Created,” “Modified,” and “Accessed” dates. However, opening or editing the file updates its modification or accessed date. If you intend to share a file with the new date(s), don’t open it (in any app) after running these PowerShell commands. Doing so discards your changes and restores the modified attributes to their original dates.

    Remove File Attributes Using Windows File Explorer

    You can’t change a file’s last viewed, edited, or creation date through File Explorer. However, you can use the utility to remove dates (and other personal data) from files you intend to share.

    1. Right-click the file whose attribute you want to remove and select Properties.

    "Properties" option highlighted in Windows context menu

    1. Open the Details tab and select Remove Properties and Personal Information.

    Steps to remove a file's modified date

    1. Choose Remove the following properties from this file: and select the Manager checkbox. The option removes the “Content created,” “Date last saved,” and “Last printed” dates from files. Select OK to proceed.

    Steps to remove a file's modified date

    1. If you want to remove all attributes from the file, choose Create a copy with all possible properties removed and select OK.

    Steps to remove a file's creation or modified dateFile Explorer will create a new copy of the file (without any personal information) in the same folder as the original file.

    1. Select OK on the file properties window to save the changes.

    Steps to remove modified date from files in Windows

    You can also remove attributes like author name, comment, etc. The attributes you can remove will vary depending on the file type or format. For image files, you can remove authors, dates, and parameters like copyright, tags, rating, etc.

    Use Attribute Changer to Change File Attributes in Windows

    Third-party apps expedite changing a file’s modified date on Windows computers. The Attribute Changer software supports Windows 11, 10, 8, and 7 and is free for personal and commercial use. It can modify the date and time attributed to documents, folders, and multimedia files.

    1. Download the latest Attribute Changer version from the developer’s website.

    Attribute Changer software download page

    1. Double-click the downloaded setup file and follow the installation instructions. Select the Install and register shell extension checkbox if it isn’t checked by default. Installing the extension adds Attribute Changer options to your PC’s right-click menu.

    Attribute Changer version 11 installation window

    1. Right-click the file whose attribute you want to edit and select Show more options.

    Context menu for an Excel document

    1. Select Change Attributes.

    "Change Attributes" highlighted in the context menu for an Excel document

    1. Open the Properties tab and select the Modify date and time stamps checkbox. Use the drop-down menus to edit the file’s creation, access, and modification date to your preference. Then select Apply and OK to save the changes.

    Steps to change files' created, accessed, and modified date using Attribute Changer

    1. Select OK on the confirmation prompt to save the edited dates.

    Attribute Changer process confirmation screen

    1. The app will switch to the “Reporting” tab and list changes made to the file’s attributes. Select OK again to close the tool.

    Attribute Changer report screen

    Date Modification Made Easy for Windows Files

    Now you know all available options for modifying file attributes in the Windows operating system. You can change a file’s modification date (and other dates) by running the correct commands in PowerShell. If you need to remove personal information from your files, then File Explorer is your best option. Attribute Changer performs date changes and attribute removal in a few mouse clicks. Download the tool if you frequently edit the dates attributed to your files.