CallDatetime

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

Syntax

CallDatetime(function name, argument1, argument2, ...)

Function arguments:

  • function name (required):The name of the warehouse function to call.
  • argument (required): Argument(s) to pass into the warehouse function. Multiple arguments are supported.

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 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