---
id: "P:cAlgo.API.File.LastWriteTime"
kind: "property"
type: "T:cAlgo.API.File"
url: "https://help.ctrader.com/ctrader-algo/references/Utility/File/LastWriteTime/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# File.LastWriteTime

Member of [File](https://help.ctrader.com/ctrader-algo/references/Utility/File/index.md).

## LastWriteTime

Gets the time when the current file was last written to.

Environments: Desktop supported · CLI supported · Cloud not supported.

- Cloud: Throws InvalidOperationException 'Getting file info is not supported in cloud environment.'

C#:

```csharp
DateTime LastWriteTime {get;}
```

Python:

```python
file.LastWriteTime: DateTime
```

### Returns

`DateTime` — 

Available since cAlgo.API 5.7.

### Examples

C#:

```csharp
protected override void OnStart()
{
    if (DataFile.LastWriteTime < DateTime.Now.AddDays(-1))
        Print("{0} has not been updated for more than a day", DataFile.Name);
}
```

Python:

```python
from System import DateTime

if api.DataFile.LastWriteTime < DateTime.Now.AddDays(-1):
    api.Print(f"{api.DataFile.Name} has not been updated for more than a day")
```

config.json:

```json
{
  "Parameters": [
    {
      "Name": "DataFile",
      "DisplayName": "Data File",
      "Type": "File"
    }
  ]
}
```

