SELECT `justfunctions.eu.timestamp_to_string`(2023-06-24 13:01:02 UTC)
/*--Output--
2023-06-24 13:01:02
*/
CREATE OR REPLACE FUNCTION `your_project_id.your_dataset_id.timestamp_to_string`(`timestamp` TIMESTAMP)
RETURNS STRING AS (FORMAT_TIMESTAMP('%Y-%m-%d %H:%M:%S', timestamp))
OPTIONS ( description = '''Converts a <timestamp> to string format '%Y-%m-%d %H:%M:%S'.''')
SQL User Defined Function (SQL UDF)
See something wrong? Contact us or report an issue on Github.