> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# CallDatetime

> Use the Sigma CallDatetime function to call a warehouse function that returns a datetime data value.

The **CallDatetime** function calls a warehouse function that returns a datetime data value. This function is often applied to display a time column or value in different formats that require conversion.

This function isn't compatible with all data platform connections. To check if your connection supports it, see [Supported data platforms and feature compatibility](/docs/region-warehouse-and-feature-support#supported-data-platforms-and-feature-compatibility).

## Syntax

```
CallDatetime(function_name, argument)
```

Function arguments:

|                    |                                                          |
| :----------------- | :------------------------------------------------------- |
| **function\_name** | The warehouse function to call.                          |
| **argument**       | One or more arguments to pass to the warehouse function. |

## Example

A table contains a *Daily Total Seconds* column that returns the session time (in seconds) for each customer as a Number type. You can pass Snowflake's [TO\_TIME](https://docs.snowflake.com/en/sql-reference/functions/to_time) function to the **CallDatetime** function to represent the number of seconds as hours, minutes, and seconds.

```
CallDatetime("TO_TIME", Text([Daily Total Seconds]))
```

* Converts the *Daily Total Seconds* column into hours, minutes, and seconds.

Apply custom formatting to the *CallDatetime* column using %H:%M:%S as the format string to only display the time portion of the timestamp returned by the TO\_TIME function.

![Screen\_Shot\_2023-04-28\_at\_3.03.06\_PM.png](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/024657657859e1c301e5a167f4ec25a92a849a45d6d496d25c6388ff385ab04e/assets/docs-images/801e8c9-4.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260727%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260727T004934Z&X-Amz-Expires=604800&X-Amz-Signature=8dd1743010d5dfb3b71bd70d8fbe5bcae75cc96f79a15c52f4fb66ff533abd03&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

## Related resources

* [CallLogical](/docs/calllogical)
* [CallNumber](/docs/callnumber)
* [CallVariant](/docs/callvariant)
* [CallText](/docs/calltext)