TO_CHAR Function for Datetime - Oracle to Snowflake Migration

In Oracle, the TO_CHAR function allows you to convert a DATE or TIMESTAMP value a string using the specified datetime format.

Snowflake also provides the TO_CHAR function.

Oracle:

  -- Convert the current datetime to string
  SELECT TO_CHAR(SYSDATE, 'MM-DD-YYYY HH24') FROM dual; 
  # 04-23-2022 11

Snowflake:

  -- Convert the current datetime to string
  SELECT TO_CHAR(CURRENT_TIMESTAMP(0), 'MM-DD-YYYY HH24'); 
  # 04-23-2022 11

For more information, see Oracle to Snowflake Migration.