在 Snowflake 中将 'yyyymmddhhmmss' 转换为 MM/DD/YYYY HH:MM (AM/PM)
Convert 'yyyymmddhhmmss' to MM/DD/YYYY HH:MM (AM/PM) in Snowflake
我想在 Snowflake 中将包含格式为 yyyymmddhhmmss
的值的字符串转换为 MM/DD/YYYY HH:MM (AM or PM)
。该字符串包含 UTC 格式的时间。还希望最终输出在 CST 时区。
Eg of String : 20220120035900
Expected output : 01/20/2022 03:59:00
感谢帮助!
请检查下面select try_to_timestamp('20220120035900', 'YYYYMMDDHHMISS');
UTC 转换为 CST:
SELECT try_to_timestamp('20220120035900', 'YYYYMMDDHHMISS') as t_str,
t_str::timestamp_ntz as UTC_tz,
convert_timezone('UTC','America/Chicago', UTC_tz) chicago_time;
我想在 Snowflake 中将包含格式为 yyyymmddhhmmss
的值的字符串转换为 MM/DD/YYYY HH:MM (AM or PM)
。该字符串包含 UTC 格式的时间。还希望最终输出在 CST 时区。
Eg of String : 20220120035900
Expected output : 01/20/2022 03:59:00
感谢帮助!
请检查下面select try_to_timestamp('20220120035900', 'YYYYMMDDHHMISS');
UTC 转换为 CST:
SELECT try_to_timestamp('20220120035900', 'YYYYMMDDHHMISS') as t_str,
t_str::timestamp_ntz as UTC_tz,
convert_timezone('UTC','America/Chicago', UTC_tz) chicago_time;