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

</div>

Property

# FolderItem.CreationDate

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

<div class="warning">

<div class="title">

Warning

</div>

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

</div>

## Description

The creation date of the **FolderItem**.

## Notes

Do not modify the <span class="title-ref">CreationDate</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">CreationDate</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">CreationDate</span>.

On Linux, the <span class="title-ref">CreationDate</span> cannot be modified. Attempting to change it raises an `UnsupportedOperationException</api/exceptions/unsupportedoperationexception>`. Also, the <span class="title-ref">CreationDate</span> may not be accurate as many Linux file systems do NOT actually track the creation date.

## Sample code

This example displays the creation date in the ShortDate format.

``` xojo
Dim f As New FolderItem
MsgBox(f.CreationDate.ShortDate)
```

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

Changing <span class="title-ref">CreationDate</span> is slightly more complex. You cannot just change the <span class="title-ref">CreationDate</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">CreationDate</span>. Here is an example that sets a file's creation 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.CreationDate = newDate
End If
```

## Compatibility

All project types on all supported operating systems.
