How to Change File Date or Timestamp in Windows

Windows maintains three different date/timestamps for every file and folder. They are “Date Created,” “Date Modified,” and “Date Accessed.” You may have to change the modified, created, or last accessed timestamp of a file or folder in some situations.

For instance, I had to change the timestamp of some files to test the Robocopy sync method when writing an article on folder compare and synchronization. Other users may need to change the date or time of a file for backup or archiving purposes.

Let’s see some methods to change the created date, modified date, or last accessed date of files in this article.

Change File or Folder Timestamp

Change File Creation, Last Accessed or Modified Date

Using PowerShell

To change the file date using PowerShell, here are the commands you need to run:

Change the creation date/timestamp of a file named log1.txt:

(Get-Item "D:\Test\log1.txt").CreationTime=("3 August 2019 17:00:00")

Change the last write date/timestamp of a file named log1.txt:

(Get-Item "D:\Test\log1.txt").LastWriteTime=("3 August 2019 17:10:00")

Change the last accessed date/timestamp of a file named log1.txt:

(Get-Item "D:\Test\log1.txt").LastAccessTime=("3 August 2019 17:10:00")

Change the date/timestamp of all files in a folder named Test:

To change the timestamp of all files in a folder, use the following syntax:

Get-ChildItem -force d:\test\ * | ForEach-Object{$_.CreationTime = ("3 August 2019 17:00:00")}
Get-ChildItem -force d:\test\ * | ForEach-Object{$_.LastWriteTime = ("3 August 2019 17:10:00")}
Get-ChildItem -force d:\test\ * | ForEach-Object{$_.LastAccessTime = ("3 August 2019 17:10:00")}

Note that the above command changes the timestamp for every file and subfolder in a folder. To apply the change only for files (i.e., exclude sub-folders), use this syntax:

Get-ChildItem -force d:\test\ * | Where-Object {! $_.PSIsContainer} | ForEach-Object{$_.CreationTime = ("3 August 2019 17:00:00")}
Get-ChildItem -force d:\test\ * | Where-Object {! $_.PSIsContainer} | ForEach-Object{$_.LastWriteTime = ("3 August 2019 17:10:00")}
Get-ChildItem -force d:\test\ * | Where-Object {! $_.PSIsContainer} | ForEach-Object{$_.LastAccessTime = ("3 August 2019 17:10:00")}

Change the last write date/timestamp of a “Folder”

(Get-Item "D:\Test\").LastWriteTime=("3 August 2019 17:00:00")

View Created, Modified, and Last accessed date of all files in a folder

To view the date modified, date created, and date last written data for all files in a folder, use the following command-line syntax:

Get-ChildItem -force "D:\Test\"  | Select-Object Name, CreationTime, LastWriteTime, LastAccessTime


foreach ($objFile in Get-ChildItem "D:\Test\*.*") { '"' + $objFile.Name + '" | ' + $objFile.CreationTime + ' | ' + $objFile.LastWriteTime + ' | ' + $objFile.LastAccessTime}

You’ll see an output like this:

"log1.txt" | 08/03/2019 17:00:00 | 08/03/2019 17:10:00 | 08/03/2019 17:10:00
"log2.txt" | 08/03/2019 17:00:00 | 08/03/2019 17:10:00 | 08/03/2019 17:10:00
"log3.txt" | 08/03/2019 17:00:00 | 08/03/2019 17:10:00 | 08/03/2019 17:10:00
"log4.txt" | 08/03/2019 17:00:00 | 08/03/2019 17:10:00 | 08/03/2019 17:10:00

change last modified file date or timestamp using powershell

Using NirCmd from Nirsoft

Using NirCmd, a multi-purpose command-line tool from, you can change the file date and timestamp.

Here is the command-line syntax to change the file timestamp using NirCmd:

nircmd.exe setfiletime [filename or wildcard] [Created Date] {Modified Date} {Accessed Date}
  • The first parameter can be a single filename or wildcard string.
  • The date parameters must be specified in the following format: “dd-mm-yyyy hh:mm:ss“.
  • If a date parameter is not specified or you specify an empty string (“”), the date won’t be changed.
  • If you specify "now" as the date parameter, the current date and time will be used.


nircmd.exe setfiletime "d:\test\log1.txt" "03/08/2019 17:00:00" "" "03/08/2019 17:10:00"
nircmd.exe setfiletime "d:\test\log2.txt" now now now
nircmd.exe setfiletime "d:\test\log3.txt" now "" now
nircmd.exe setfiletime "d:\test\log4.txt" "03/08/2019 17:00:00" "03/08/2019 17:10:00" now

To change the timestamp of all text files in a folder, here’s the command-line syntax:

nircmd.exe setfiletime "d:\test\*.txt" "03/08/2019 17:00:00" "03/08/2019 17:10:00" "03/08/2019 17:10:00"

Using BulkFileChanger from Nirsoft

BulkFileChanger is another useful tool from that can modify the created, modified, or accessed time of one or multiple files. It can also change the file attributes (Read-Only, Hidden, System) en masse.

Start BulkFileChanger and add the files into it. When adding files to the list, you can choose to add files in sub-folders and set the recursion level accordingly.

change last modified file date or timestamp bulkfilechanger

Select all files, and click Change Time/Attributes from the Action menu.

You may want to uncheck the Time is specified in GMT first, as most of us prefer inputting the local time rather than the GMT.

Input the Created, Modified, or Accessed date/time. To fill up the current time in all the fields, click on the Fill Current Time button below.

change last modified file date or timestamp bulkfilechanger

For images taken from a camera, the EXIF or the metadata field contains the Date taken field, which is separate from NTFS’s date modified/created data. You can view the EXIF data from the JPG file’s properties or using the ExifDataView utility from

change last modified file date or timestamp bulkfilechanger

That said, BulkFileChanger also allows you to change the Date Taken timestamp (EXIF metadata). To change the date metadata, click on the No Change button, and select the appropriate option.

change last modified file date or timestamp bulkfilechanger

The EXIF – Generated Time corresponds to the Date Taken metadata, and this field is displayed under the Date column of File Explorer. Also, many programs use this value as the official date/time of the picture.

Note that you can change the EXIF date of a camera image only if the date/time values already exist inside the .jpg files. BulkFileChanger cannot add new fields into the EXIF data.

And, optionally, you can also copy the timestamp from Modified, Created, Accessed, EXIT – Generated Time, EXIT – Stored Time, or the EXIT – Modified Time and apply the same to other date fields automatically.

Command-line support

BulkFileChanger also supports command-line operations so that you don’t have to open the GUI every time. Check out BulkFileChanger homepage for command-line help/the list of arguments supported.

Attribute Changer

Attribute Changer is an excellent freeware program that can do the following:

  • Modify file attributes.
  • Change file or file extension or folder names to capitalize, lowercase, or uppercase.
  • Manipulate the date and time of files and folders.
  • Modify date and time information stored in digital photos. You can add or subtract values and even synchronize with file date and time.
  • Exclude or include objects based on multiple criteria, such as attributes, date, time, size, and file or folder name wildcards.
  • A Simulation mode features a preview of all modifications in a detailed reporting window before they get applied. It’s a safe option with which you can conduct a dry run.

You can download Attribute Changer from

After installing the program, all you need to do is select a file or folder or multiple items and choose the Change Attributes context menu entry.

attributes changer change file timestamp date

Alter the date and timestamps for the selected file(s) and/or folder(s). If you’re going to use Advanced (filter) operations, it would be better to run it in Simulation mode first to ensure the outcome is perfect.

attributes changer change file timestamp date

Attribute Changer also logs and the actions (every file and folder modification) into a tab-delimited text file that can be imported in Excel.

One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded in 2005.

20 thoughts on “How to Change File Date or Timestamp in Windows”

  1. Interestingly, I have some movie files in a folder and they are showing up with another column that is just labelled ‘Date’. It is separate to the Date Created and Date Modified columns. I noticed it because the file has only just been generated but the date is saying 01 Jan 1970. Does anyone know what this is and how to manipulate it

    • @Freemanblu: The “Date” column data comes from the EXIF (metadata). Pls refer to the setting “EXIF – Generated Time” referenced in this article.

    • 01 jan 1970 00h00m00s GMT is the time origin in UNIX and most other OS (operating systems) derived from it. So in your case that means that the cells in the “Date” of your case are just in their native original state, i.e. zero.
      Versailles, Mon 07 Feb 2022 10:50:55 +0100

  2. Thank you!

    This worked for me to edit last edit date in files folders and subfolders

    Get-ChildItem -Path “V:\” -Recurse –File | ForEach-Object{$_.LastWriteTime = (“21 April 2020 12:00:00”)}

    • Hi – does this automatically change the folder/subfolders “modified” date and time to the value of the last edited file in that folder/subfolder, or does this just give you the value to change it manually? If it’s not “automatically” changed, are there any commands that may be added to accomplish this, or perhaps a script that may be written to accomplish this? Thanks so much. -Cfguy

  3. I get an error I don’t understand how to work around with the powershell example

    PS E:\Videos> (Get-Item “E:\Videos\test.mp4”).CreationTime=(“4 July 2020 6:10:00”)
    Exception setting “CreationTime”: “Access to the path ‘E:\Videos\test.mp4’ is denied.”
    At line:1 char:1
    + (Get-Item “E:\Videos\test …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], SetValueInvocationException
    + FullyQualifiedErrorId : ExceptionWhenSetting

  4. FreeCommander has “Multiple Rename” function. It is quite powerful and has much more to offer than only date and time and definitely more convenient than PowerShell etc.

  5. Hi – THanks so much for the great article. 🙂 I have a unique situation in that my secondary “data” hard drive was getting full, so I used Paragon to backup the original drive and then restore to new, larger secondary hard drive. On the new drive, Paragon left all the file “modified” dates intact (from the original secondary drive); however, it changed the directory “modified” dates to today’s dates, instead of the value on the original secondary drive. My question is: is there an easy way (command line or program) to change all the “modified” folder dates on the new secondary drive to either the date of the last modified file in the directory (for example, the command posted earlier in the comments (Get-ChildItem -Path “V:\” -Recurse –File | ForEach-Object{$_.LastWriteTime = (“21 April 2020 12:00:00”)}) or, if not this, a program that would allow me to compare the “modified” dates of the folders on both old and new (still attached to computer) hard drives, and change them to the date from the old hard drive? If you would please let me know about this, I would really appreciate it. Thanks. -Cfguy.

    • Hi, Did you ever work out how to resolve this?
      I have a similar problem – I copied one large folder to a large new drive and then deleted the old folder. The folders on the new location were created with “now” file stamps, though files within the folders kept their old timestamps by and large.
      Now that time has passed, I realize this problem. Had I realized earlier (before the source deletion), there are ways to preserve the original folder timestamps like using Robocopy.
      The problem I have is that the original source is deleted and there is no backup.
      What I would like is a script that reads the contents of each folder to determine the oldest timestamp and then apply it to the parent folder.
      Unfortunately, I don’t have the required scripting skills.

  6. You said change the date for the file by nircmd but you did not change the folder date by it.
    So for change date of folders with nircmd 1.70 or above can use this command:
    nircmd setfilefoldertime “d:\folder” now now now

  7. for me command lines are too complex. What i´ve red about attribute changer is that it changes attributes on properties but not in details, or another pc.
    Is there an option not based in command lines which i cant understand, to set a creation date that really works also on details/another pc?
    Thanks a lot.


Leave a Comment