将纪元时间戳转换为天蓝色数据工厂中的日期时间
我正在天蓝色数据工厂中处理数据流,并尝试将纪元格式的时间戳转换为日期。
时间戳的值为“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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
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."
以防万一有人想知道:
如果时间戳以毫秒为单位,则需要将时间戳转换为一样长。
Just in case someone is wondering:
If the timestamp comes in milliseconds, one need to cast the timestamp as long.