简体   繁体   English

如何在雅典娜中将纪元转换为日期?

[英]How to convert Epoch to date in athena?

I have written a query to convert epoch to date conversion in Athena but the result is not expected我已经编写了一个查询以在 Athena 中将纪元转换为日期转换,但结果不是预期的

select from_unixtime(cast(epoch_values as bigint))as dates from mybdbase

result is:结果是:

dates日期
+54113-07-13 10:11:53.000 +54113-07-13 10:11:53.000
+54113-07-13 10:11:57.000 +54113-07-13 10:11:57.000

The year is shown in the above table, How to solve this?年份如上表所示,如何解决?

use this: from_unixtime(event_timestamp/1000000)使用这个: from_unixtime(event_timestamp/1000000)

you could validate the results with this page https://www.epochconverter.com/您可以使用此页面https://www.epochconverter.com/验证结果

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将纪元纳秒值索引为 Elasticsearch 中的日期或 date_nano? - How to index an epoch nanoseconds value as a date or date_nano in Elasticsearch? 如何在 Athena 中将 varchar 取消嵌套到 json - How do I Unnest varchar to json in Athena 如何用 moto 模拟 AWS athena/awswrangler? - How to mock AWS athena/awswrangler with moto? 如何将 firebase 中的时间戳数据类型转换为日期? - How to convert timestamp data type in firebase to date? 如何获取athena aws中所有表的记录数 - How to get the record count of all tables in athena aws 如何从 AWS Athena 中的 JSON 对象数组中提取字段? - How to extract a field from an array of JSON objects in AWS Athena? 如何将 Firestore 时间戳转换为 Date() - Firestore V9 - How to convert Firestore Timestamp to Date() - Firestore V9 将毫秒转换为 Firestore 日期 - Convert milliseconds to Firestore date 如何将字符串日期 dd-mmm-yyyy hh:mm 特定格式转换为日期格式 - How to convert String date dd-mmm-yyyy hh:mm specific format to Date format 在使用 dbeaver 时,如何添加添加了 aws athena 查询引擎 3 新参数的 jdbc 参数? - How can I add jdbc parameter that added new parameter of aws athena query engine 3 while using dbeaver?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM