In Windows 10 and 11, every file and folder contains certain attributes that help define their properties. In this post, we will discuss the following attributes: Date Modified, Date Created, and Date Accessed. If you need to modify these attributes, there are a few methods you can use, including the command-line approach and some third-party tools.
This information can be found in every file or folder, regardless of the type of file, which means that each document, photo, video, zipped file, and folder carries this information with them wherever they are transferred. Those who are interested in knowing this information about a particular item only need to examine its properties or metadata.
The date modified, the date created, and the date accessed are referred to as timestamps. There is a record of the last time the respective changes were made. In addition, these are used by the system to save previous versions of a file/folder by reading, if it is designed to archive or save its last version.
Table of Contents
Date Modified, Date Created, and Date Accessed
As in the example below, the 3 attributes can be seen in File Explorer. You may notice how each category displays both the date as well as the time of the event for each item.
Date Modified depicts the event when the last changes were made to the item. In the case of a text document, anything added or removed from it will automatically update the Date Modified timestamp to the current time. In the case of a folder, any changes made to the contents within the folder, such as new items added or removed, will change the Date Modified timestamp. However, if you were to modify a file within a folder, the Date Modified timestamp of the parent folder will not change.
Some may think that the Date Modified attribute is dependent upon the hard drive it is saved on, and not the metadata of the item. However, this theory is not true. You can verify this by creating a test document in one place, and then moving it to another storage device at another time. You will notice that the new copy of the item still retains its old Date Modified timestamp.
Similarly, Date Created is the date and time when an item was first created. This does not change when you make changes to an item, nor does copying it to another storage device. However, if you make a new copy of an existing file or a folder, the Date Created is automatically updated for the new copy to the current time.
Lastly, as the name suggests, the Date Accessed tells us of the last time an item was accessed. It does not necessarily have to be modified Read-only privileges will also change this timestamp to the current time.
How to Modify file and folder timestamps
Now that you understand what each timestamp indicates and how they are modified, let us move on to manually change them in case you ever need to.
All 3 timestamps can be changed to your requirements manually. To do so, there are tools present on the internet, and it can also be done through your Windows command line. Remember that modifications need to be a time of the past, and not of the future. Setting the timestamps to a future time will make the information disappear from the Explorer.
Change Date Modified, Date Created, and Date Accessed using Windows PowerShell
Windows PowerShell is a command-line tool that comes preinstalled in Windows 10 and 11. It is super-handy for superusers as it allows you not only to control your Operating System but also lets you automate tasks. Similarly, you can use the commands given below to modify the 3 timestamps to your preferences.
Change Date Modified
Launch Windows PowerShell with administrative privileges and then use the following command to change the Date Modified in the file/folder:
(Get-Item "PathToItem").LastWriteTime=("14 August 2016 13:14:00")
Remember to replace PathToItem in the command above with the complete path to the file/folder that you wish to change the attribute of (including the file type). Also, change the date and time to your preference. Here is an example:
(Get-Item "D:\TestDocument.txt").LastWriteTime=("14 August 2016 13:14:00")
Run the command above and make changes to the text file in the D drive named “TestDocument.txt.” This was then verified through File Explorer. Here are the results:
Change Date Created
Likewise, you can also manipulate the Date Created attribute of a file/folder using the command below:
(Get-Item "PathToItem").CreationTime=("13 August 2015 13:18:00")
As in the last example, change the PathToItem as well as the date and time of your preference in the command above. Here is an example of us changing the Date Created attribute of a folder named “Newfolder” in the D drive:
As expected, the Date Created attribute has been changed.
Change Date Accessed
To manipulate the Date Accessed attribute using PowerShell, use the command below:
(Get-Item "PathToItem").LastAccessTime=("3 August 2019 17:10:00")
Always change the PathToItem as well as the date and time according to your preferences.
We shall not dwell on an example and its results, as you have already seen in the manipulation of the Date Modified and Date Created timestamps.
However, in case you notice that the Date Accessed is not changing on your system, it is very likely that the feature has been turned off. You can easily activate it by launching Command Prompt with administrative privileges, and then pasting the command given below:
sutil behavior set disablelastaccess 0
You should now be able to see an updated Date Accessed timestamp each time you open a file or a folder.
Change all 3 attributes of all items within a folder
You can also change all 3 timestamps of all the items within a folder. To do so, simply use the commands shown below, adjust them to your requirements, and voila! You are done changing the timestamps in a jiffy.
Get-ChildItem -force PathToItem * | ForEach-Object{$_.CreationTime = ("14 August 2016 13:14:00")}
Get-ChildItem -force PathToItem * | ForEach-Object{$_.LastWriteTime = ("14 August 2016 13:18:00")}
Get-ChildItem -force PathToItem * | ForEach-Object{$_.LastAccessTime = ("14 August 2016 13:22:00")}
Remember to replace PathToItem with the complete path of the folder as well as the date and time that you wish to configure.
As you can see in the image below, all contents within the folder named “Newfolder” have updated their attributes as commanded through PowerShell.
There are other similar commands you can use in Windows PowerShell to change the attributes of any file or folder. Nonetheless, all have a similar effect to that which we have discussed in this post.
Change Date Modified, Date Created, and Date Accessed using Attribute Changer
Attribute Changer is a small GUI-based utility that you can install on your system to manipulate the attributes of any file or folder using the context menu. Follow the steps below to install the tool and then learn how to use it in a few easy steps.
Open the Attribute Changer page and then click on Get Attribute Changer. The setup will then start to download. Once completed, click on it to begin the installation. The installation wizard will then open. Agree to the terms and conditions and follow through with the wizard in a few quick steps. The installation part only takes a few minutes.
Once installed, the app will not open by itself, since it is programmed to be launched through the context menu when you right-click a file or a folder.
To change a file or folder’s Date Modified, Date Created, or Date Accessed, simply right-click on it and then click Change Attributes on the context menu.
Note: You may need to click Show more options in the context menu if you are using Windows 11.
Clicking Change Attributes will open the Attribute Changer in a new window showing the details of the item that you have selected. In the File Properties tab, check the box next to “Modify date and time stamps.” The greyed-out portion below will now be active and can be modified. You can now adjust the Date Modified, Date Created and Date Accessed according to your own preferences using these options.
Once the required changes are made, click on Apply and then OK. You will now notice that the changes have been updated in File Explorer.
We would like to point out that changing the timestamps of an entire folder will not affect its contents. Therefore, you will be required to change them for each item individually.
Change Date Modified, Date Created, and Date Accessed using NirCmd
NirCmd is a third-party command-line tool by Nirsoft that allows you to perform certain advanced tasks through the Command Prompt. It can also be used to change the Date Modified, Date Created, and the Date Accessed attributes of any file on the computer.
Use the following steps to download and use NirCmd to modify these attributes for any given file:\
-
First, download the NirCmd utility for their website.
-
Extract the package by right-clicking it, and then clicking “Extract all.” Click Extract again on the extraction wizard.
-
Now, press the Windows Key + R to open the Run Command box.
-
Type in “cmd” and press CTRL + Shift + Enter to launch an elevated Command Prompt.
-
Use the “CD” command, in the following syntax, followed by the patch to the extracted folder, to change the directory to it.
Cd /d [PathToExtractedFolder]
Navigate to the extracted NirCmd folder -
Now use the following syntax to change the timestamp of your respective file by providing its complete path. Also, specify the date parameters in the format:
dd-mm-yyyy hh:mm:ss
Note: You can leave the string empty by inserting only parenthesis if you want to keep a date unchanged.
nircmd.exe setfiletime [FilePath&Name] [Created Date] [Modified Date] [Accessed Date]
Change file timestamp using NirCmd
After performing the steps above, you will notice that the new timestamp has been applied to the file successfully.
To change the timestamp of all the files with a folder, use an asterisk (*) instead of the file name in the command, like in this example:
nircmd.exe setfiletime "D:\Newfolder\*.txt" "11-11-2011" "11-11-2011" "11-11-2011"
Reasons to change date/timestamp
You might want to change the timestamp, the date accessed, the date created, or the date modified for a file or folder for several reasons. Here are a few reasons why one might want to:
- Changing the date parameter helps sort files accordingly. For example, you may want to sort all the files according to their “Date Modified” attribute, but one file is not where it should be. Therefore, you may need to change its date to bring it to its correct place.
- You may want to perform a version control if you are a developer. For example, if a file version is out of its correct modified date, you can correct it before rolling it out.
- Maintaining accurate records of file creation date, modified date, and accessed date is sometimes a legal requirement for some organizations. It is possible to guarantee adherence to these rules by changing these attributes.
- You may want to change the timestamp to protect your privacy and security, especially if you are planning on sharing the items with someone else and do not want them to find out its exact date of creation, or the last time it was accessed.
Closing words
Timestamps provide insight into the digital content they are associated with. Documents and folders contain these digital time signatures embedded in their metadata. Using the guide provided in this post, these can be modified for any given reason in a few minutes.
Additionally, there are other tools available online for manipulating these stamps. However, Attribute Changer has proven to be the most convenient to use.
When you create or copy a folder / file on a computer, it is automatically assigned a set of attributes such as date, size, and type. These attributes can be helpful when you want to search for a specific file. The date attributes show details of when the file was created, modified and last accessed. You may want to change the date attributes to synchronize file dates, hide track of your activities or for whatever other reason. This guide shows you the various ways of changing the date attributes of a folder or a file in Windows 10.
Related: How to find last updated date of a webpage?
How to View File / Folder Date Attributes?
Follow the below instructions to find the date attributes of any file or folder in Windows computer.
- Open the folder / file location right-click the folder or file and select “Properties”.
- Under the “General” tab, you will find the creation date.
- Alternatively, open the file explorer and navigate to where you have saved the file.
- Click the “View” menu and enable the “Details pane”.
- When you click the file, you will see the date attributes on the right-hand pane.
Now, let’s move on to changing the date attributes using different methods.
Method 1: Working Around the System Date
You can modify the file or folder creation date by adjusting the system time and then copy and save the file / folder afresh.
Step 1: Change the System Date and Time
- Right-click the date and time on the notification area and select “Adjust date/time” from the resulting menu.
- Slide the toggle switch to the left to switch off the “Set time automatically” option.
- Click the “Change” button to manually set the date and time. Adjust the date and
- Change the time to the preferred file or folder creation time and click the “Change” button to save the changes.
Step 2: Copy or Save File as New
- Now copy and rename the folder or open the file, go to the file menu and select “Save as” option to save the file as a new one.
- The date attributes of the newly copied folder will take the value of the current system date and time.
- Open the file properties to confirm that the attributes have been changed.
- You can now restore the correct system date and time.
Method 2: Change File / Folder Attributes in Windows PowerShell
You can modify the file attributes using commands in PowerShell.
Step 1: Show File Attributes
- Right-click the windows start button and select “Windows PowerShell (Admin) from the resulting menu.
- Type the following command in PowerShell and press enter:
Get-ItemProperty File_Path | Format-list -Property * -Force
- Remember to replace the file-path in the command with the actual path.
- This will display all the attributes for the file.
Step 2: Change the Date Attributes
- Run the following command in PowerShell
$(Get-Item File-name).creationtime=$(Get-Date "mm/dd/yyyy")
- Replace the File-name with the name of your file and the set your preferred creation date.
- List the attributes again to check whether the creation date has been changed.
- You can also change the last modified and last write time using the following two commands:
$(Get-Item File-Name).lastaccesstime=$(Get-Date "mm/dd/yyyy")
$(Get-Item File-Name).lastwritetime=$(Get-Date "mm/dd/yyyy")
Method 3: Change Date Attributes Using Third-Party Apps
The above two methods are effective but are not easy for everyone. Fortunately, there are several third-party solutions that you can use to save time. In this guide we will explore two of such solutions which are free and work smoothly in Windows 10.
Solution 1: Using Change Timestamp Software
Change Timestamp is a free and a light app that you can use to modify the date and time properties of files and folders. The app is downloadable in a portable executable file.
Step 1: Download and Run Change Timestamp in Windows 10
- You can download Change Timestamp from this link and save the zip file in your computer.
- Extract the content of the zip file and run the .exe file to launch the tool.
- The tool opens in a small window that contains all the features you need to modify the file or folder attributes.
Step 2: Change the Created, Modified and Accessed Time
- Under the “New Date” and “New Time” sections, type in or use the arrows to set the preferred date and time.
- Below the date and time fields, you can tick the option to retain the original time or date.
- You can also right click anywhere on the interface and choose the option to set the date and time value to the current system date and time.
- Tick the appropriate box to change the “The file was created”, “Last Modified” and “Last Accessed for reading” timestamps.
Step 3: Applying the New Timestamp to Folder/File
- Once you are done setting the Timestamps on the interface, now you need to apply the changes to your target file or folder.
- To do so, open the folder / file location and then drag and drop the folder or file over the Change Timestamp window.
- The folder will automatically take the new date and time properties.
Solution 2: How to Modify File/ Folder Date Attributes Using BulkFileChanger (BFC)
BulkFileChanger (BFC) is another free utility that enables you to change created, modified and last accessed timestamps among other attributes of multiple files all at once.
Step 1: Download and Open the BFC Utility
- Visit the BFC Download page, scroll down and click the link to download the zip file with either the 64 bit or 32 bit version.
- Extract the downloaded zip file and double click “BulkFileChanger.exe” to launch the tool.
- No installations or any other software required and you are ready to go.
Step 2: How to Add Files to BFC?
There are several ways of loading files to the BFC utility:
- Navigate to the target files or folder copy and paste the files on the BFC window to add them to the tool.
- Another option is to select the files you want to add. Then drag and drop them on the interface.
- Alternatively, click the BFC “File” at the top-left corner and select the “Add files” option.
- Browse your PC and select the multiple files you want to add.
- Your added files will be listed on the BFC dashboard.
- You can right click a file and select “Properties” to view the current attributes.
- If you accidentally added a file, you can remove it by clicking it and then press the delete button.
Step 3: Modifying the File Attributes in BFC
- You can modify the properties of a single file or multiple files. Select the file(s) you want to modify or press “Ctrl + A” keys to select all added files.
- Click the “Actions” tab and select “Change file time / Attributes” options.
- On the resulting popup, you can edit “Accessed”, “Modified” and “Created” timestamps using the arrow for date and time fields.
- You can also modify time by adding or subtracting time to the current settings.
- Once you are done with the time settings, click the “Do it” button at the bottom of the window.
Wrapping Up
Time attributes enable you to search for files / folders by time they were created, modified or last accessed. If you want to change the timestamp for folders or files maybe to synchronize your files or for another reason, the above guide shows you the various ways of modifying file attributes in Windows 10.
Если вы видите это сообщение, значит, произошла проблема с загрузкой файлов в стилей (CSS) нашего сайта. Попробуйте сбросить кэш браузера (Ctrl+F5).
Если это не поможет, а вы находитесь в регионе, где возможны ограничения интернет-трафика с российских серверов — воспользуйтесь VPN.
Для изменения даты создания папки запустите Total Commander кликаем на «файл» жмем «изменить атрибуты» выйдет меню редактирование свойств в пункте изменения даты, выбираем нужное число, можно выбрать абсолютно любое, даже будущее время. После смены не забудьте проверить в свойствах результат mycha 7 лет назад Сначала нужно скачать программу Far-менеджер, можно отсюда. В менеджере нужно выбрать папку, дату и время создания которой надо изменить и нажать «Ctrl-A»: В строке Creation time изменить дату и время. Таким образом, решилась моя проблема с коммерческим использованием TeamViewer. Знаете ответ? |
Проблема:
Необходимо изменить дату и время создания или редактирования файла или файлов или папки или папок.
Графическое решение:
Пользуемся бесплатной утилитой SetFileDate от компании No Nonsense Software.
Зеркало:
Скриншот:
Программа не русифицирована, но визуально понятна.
Решение для командного (пакетного) файла, скрипта:
Качаем утилиту touch.exe или прямо отсюда:
Благодаря набору UNIX Shell and Utilities многие, не решаемые в среде командной строки Windows задачи, можно решить с помощью unix-подобных утилит. И в том, числе, задачу изменения даты и времени создания, модификации и доступа файла или папки с помощью утилиты touch.exe.
Справку по работе с touch.exe можно получить при запуске утилиты с принятым в Unix ключом «—help»
touch.exe —help
При этом пользователю выводится краткая подсказка
touch [-acm] [-r|-f файл] [-t [[CC]YY]MMDDhhmm.[SS]] file файл
-a — Устанавливает время последнего доступа ( access )к файлу. Время последнего изменения не устанавливается, если явно не задан ключ -m ( modify )
-c — Указывает утилите не создавать файл, если он не существует.
-m — Устанавливает время последнего изменения файла.
-r file — Использовать значения времени из файла, заданного аргументом file.
-t time — Устанавливает время последнего изменения (модификации) и доступа в соответствии с указанным форматом date_time.
Формат даты, указанный в ключе -t задается в соответствии с шаблоном [[СС]YY]MMDDhhmm[.SS]:
СС — первые две цифры года (век).
YY — последние две цифры года.
MM — двузначный номер месяца.
DD — двузначный номер дня.
hh — значение часов даты.
mm — значение минут даты.
SS — значение секунд даты.
Примеры использования утилиты touch.exe в командной строке Windows:
Изменить время доступа и модификации файла C:\folder\myfile.txt на текущее. Если файл не существует, он будет создан с нулевой длиной и текущим временем создания, модификации и доступа:
Изменить время доступа и модификации папки C:\folder на текущее:
Изменить время доступа и модификации папки C:\folder на время, установленное для файла C:\ntldr:
Установить для существующей папки «C:\folder» значение даты и времени модификации — 1998г., 8 марта, 1 час : 2 минуты :00 секунд:
Установить для существующей папки «C:\folder» значение даты и времени модификации — текущая дата, 11 час : 12 минут :30 секунд:
Изменить только время доступа, время модификации не изменяется:
Кроме утилиты touch, для модификации времени файлов (но не папок) можно воспользоваться простой и удобной программой Юрия Усманова setdate. Скачать ее так же можно прямо здесь:
Примеры использования:
Установить для файла «C:\1.txt» дату создания 22.11.2011:
Установить для файла «C:\1.txt» дату изменения (модификации) 22.11.2011:
Установить для файла «C:\1.txt» дату доступа 22.11.2011:
Установить для файла «C:\1.txt» все даты 22.11.2011:
Источник.
С помощью PowerShell можно получить значения или изменить атрибуты файлов и папок на файловой системе. В этой статье мы рассмотрим, как работать с временными метками файлов с помощью PowerShell.
Вывести дату создания, изменения и последнего доступа (открытия) файла:
Get-ChildItem -Path C:\PS\Check-KBInstalled.ps1 | select Name, Length, CreationTime, LastWriteTime, LastAccessTime
С помощью меток времени можно быстро найти все файлы созданные/измененные за определенный промежуток времени. Например, вывести все файлы в папке, созданные за последние 30 дней:
Get-ChildItem -Path c:\ps -Recurse| where -Property CreationTime -gt (Get-Date).AddDays(-30)
Можно изменить значение любой из временных меток файла. Например, изменить дату создания файла:
(Get-ChildItem -Path C:\PS\Check-KBInstalled.ps1).CreationTime=Get-Date('21.05.2010')
Изменить время последнего изменения файла на текущую дату:
(Get-ChildItem -Path C:\PS\Check-KBInstalled.ps1).LastWriteTime=Get-Date
Проверим, что временные метки файла были изменены (с помощью PowerShell и в свойствах файла в проводнике Windows):
Эти же команды используются, чтобы изменить дату создания/модификации папки:
(Get-Item -Path C:\PS\).CreationTime=Get-Date('21.05.2010 10:10')
Если нужно изменить дату модификации у всех файлов и вложенных папок, можно использовать такой однострочник:
dir c:\PS -recurse | %{$_.LastWriteTime = Get-Date('21.05.2023 10:10')}
Если нужно сделать так, чтобы даты модификации файлов немного отличались (в этом примере на 1 минуту):
dir c:\ps -file -recurse|%{$i=0} {$_.LastWriteTime = (Get-Date('21.05.2023 10:10')).AddMinutes($i); $i++}
Обратите внимание, что формат даты будет отличаться в зависимости от локали компьютера. Например, на компьютере с русской локалью при попытке задать дату в американском формате (
MM/DD/YYYY
) будет ошибка:
Get-Date : Cannot bind parameter 'Date'. Cannot convert value "12/31/2024" to type "System.DateTime". Error: "String was not recognized as a valid DateTime."
Для универсальности скрипта можно предварительно конвертировать дату в нужный формат с помощью метода ParseExact:
(Get-Item -Path "C:\PS").CreationTime = [datetime]::ParseExact("12/31/2024", "MM/dd/yyyy", $null)
Если формат даты в выражении указан неверно, появится ошибка:
The DateTime represented by the string is not supported in calendar System.Globalization.GregorianCalendar.