在 Athena / Presto 中将具有偏移量的 DateString 转换为有效的 Date/Timestamp
Convert DateString with offset to a valid Date/Timestamp in Athena / Presto
我正在尝试将日期字符串字段转换为日期。问题是字符串字段中有东部时间的偏移量。如何将其转换为日期时间?
日期字符串:2016-09-21T10:01:43-04:00
这必须在 Amazon AWS Athena 中转换为有效的日期时间。
已尝试 From_iso8601_timestamp、date_parse。但是运气不好。
presto> select from_iso8601_timestamp('2016-09-21T10:01:43-04:00');
_col0
--------------------------------
2016-09-21 10:01:43.000 -04:00
(在 Presto 309 上测试过,但也应该在 Athena 上工作)
我正在尝试将日期字符串字段转换为日期。问题是字符串字段中有东部时间的偏移量。如何将其转换为日期时间?
日期字符串:2016-09-21T10:01:43-04:00
这必须在 Amazon AWS Athena 中转换为有效的日期时间。 已尝试 From_iso8601_timestamp、date_parse。但是运气不好。
presto> select from_iso8601_timestamp('2016-09-21T10:01:43-04:00');
_col0
--------------------------------
2016-09-21 10:01:43.000 -04:00
(在 Presto 309 上测试过,但也应该在 Athena 上工作)