将纪元时间戳转换为天蓝色数据工厂中的日期时间

发布于 2025-01-13 13:43:29 字数 207 浏览 1 评论 0原文

我正在天蓝色数据工厂中处理数据流,并尝试将纪元格式的时间戳转换为日期。

时间戳的值为“1574067907751”,我尝试了表达式: 截止日期(至时间戳(1574067907751*1000l)) 或者 toDate(toTimestamp(toInteger('1574067907751')*1000l,'yyyy-MM-dd HH:mm:ss'))

还有其他方法吗?

I'm working with data flow in azure data factory and i tried to convert an epoch formatted timestamp to date.

the value of the timestamp is '1574067907751' and i tried expressions :
toDate(toTimestamp(1574067907751*1000l))
or
toDate(toTimestamp(toInteger('1574067907751')*1000l,'yyyy-MM-dd HH:mm:ss'))

there is any other way to do that ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

长伴 2025-01-20 13:43:29

https://learn.microsoft.com/en-us/azure/data-factory/concepts-data-flow-expression-builder#convert-to-dates-or-timestamps

“要转换毫秒从纪元到日期或时间戳,请使用 toTimestamp()。如果时间以秒为单位,则乘以 1,000。

toTimestamp(1574127407*1000l)

上一个表达式末尾的尾随“l”表示作为内联语法转换为 long 类型。

https://learn.microsoft.com/en-us/azure/data-factory/concepts-data-flow-expression-builder#convert-to-dates-or-timestamps

"To convert milliseconds from epoch to a date or timestamp, use toTimestamp(). If time is coming in seconds, multiply by 1,000.

toTimestamp(1574127407*1000l)

The trailing "l" at the end of the previous expression signifies conversion to a long type as inline syntax."

梦在深巷 2025-01-20 13:43:29

以防万一有人想知道:

如果时间戳以毫秒为单位,则需要将时间戳转换为一样长。

toTimestamp(toLong(time_milliseconds))

Just in case someone is wondering:

If the timestamp comes in milliseconds, one need to cast the timestamp as long.

toTimestamp(toLong(time_milliseconds))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文