【发布时间】:2020-10-16 11:16:43
【问题描述】:
我有一个来自源数据的时间戳字符串值,我想将其转换为所需的格式。非常感谢任何关于将字符串转换为时间戳的想法。
String value of source data
'Fri Oct 16 03:27:06 PDT 2020'
I want above string to be converted into
YYYY-MM-DD HH24:MI:SS
which should be like from the sample string shared
2020-10-16 03:27:06
As of now trying with below, but this sounds like not a good practice to have.
select to_timestamp(substr('Fri Oct 16 03:27:06 PDT 2020',5,15)||' '||substr('Fri Oct 16 03:27:06 PDT 2020',25),'MON DD HH24:MI:SS YYYY');
对实现预期输出的任何帮助都会很棒。谢谢!
【问题讨论】:
标签: datetime timestamp snowflake-cloud-data-platform