<div class="meta" robots="noindex">

</div>

Property

# FolderItem.ModificationDate

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `FolderItem.ModificationDateTime<folderitem.modificationdatetime>` as a replacement.

</div>

## Description

The modification date of the **FolderItem**.

## Notes

Do not modify the <span class="title-ref">ModificationDate</span> directly. Instead always assign a new `DateTime</api/data_types/datetime>` instance to it. Refer to the example below.

On Windows, the <span class="title-ref">ModificationDate</span> cannot be changed if the file is open. This includes if it is open using a `BinaryStream</api/files/binarystream>`, `TextInputStream</api/files/textinputstream>` or `TextOutputStream</api/files/textoutputstream>`. Close the file before changing the <span class="title-ref">ModificationDate</span>.

## Sample code

This example displays the modification date in the ShortDate format.

``` xojo
Dim f As New FolderItem
f = GetOpenFolderItem("")
If f <> Nil Then
  MsgBox(f.ModificationDate.ShortDate)
End If
```

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Changing <span class="title-ref">ModificationDate</span> is slightly more complex. You cannot just change the <span class="title-ref">ModificationDate</span> property directly because you will be changing a date that is not persistent. Instead you need to create a new date instance with the date you want and then assign that to <span class="title-ref">ModificationDate</span>. Here is an example that "touches" a file by settings its modification date to the current date and time:

``` xojo
Dim f As New FolderItem
f = GetOpenFolderItem("")

If f <> Nil Then
  Dim newDate As New Date
  f.ModificationDate = newDate
End If
```

## Compatibility

All project types on all supported operating systems.
