---
url: >-
  /statelake/scripting-reference/functions-and-procedures/datetime-functions/timeof.md
---

# TimeOf

The **TimeOf** function strips the date portion from a **TDateTime** value, by extracting the time part from the parameter **AValue** and returning the result.

The date portion of **AValue** is set to 0 - or 30/12/1899, and is excluded.

**Declaration**: Function TimeOf(const AValue: TDateTime): TDateTime;

An example follows.

```pascal
procedure OnMapEvent(var Value:Variant);
var
  DispTime : string;
  TrimTime : TDateTime;
begin
  TrimTime := TimeOf(Now);
  DispTime := FormatDateTime('hh:nn:ss.zzz', TrimTime);
  LogInfo('Whole time is  : ' + DispTime);
  LogInfo('');
end;
```

**TimeOf** has similar functionality to **Time**.
