# TimeOfDay

{% hint style="info" %}
The **`TimeOfDay()`** function returns the duration that represents the fraction of the day that has elapsed since midnight.

This function is NOT SQL compatible. For more information about SQL compatibility, see our [documentation](https://docs.wem.io/platform/wemreference/sql-compatibility).
{% endhint %}

{% hint style="success" %}
Returns the duration that represents the fraction of the day that has elapsed since midnight.

Returns <mark style="color:red;">**`Unknown`**</mark> if one of the parameter values is unknown or outside the common valid date boundaries.
{% endhint %}

### Syntax

<details>

<summary><code>TimeOfDay(</code><mark style="color:blue;"><code>datetime</code></mark><code>)</code></summary>

`TimeOfDay('2017-03-31T13:27:00')`\
\=>*Result:* '13h27m'

`TimeOfDay()`\
\=>*Result: unknown*

</details>

### Parameters

<table><thead><tr><th width="150">Name</th><th width="150">Type</th><th width="150" align="center">Required</th><th width="248.15953250810662">Description</th><th data-hidden>Required?</th></tr></thead><tbody><tr><td><mark style="color:blue;"><code>datetime</code></mark></td><td>date time</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2611">☑️</span></td><td>a specified date and time</td><td>yes</td></tr></tbody></table>
