使用SSIS将DateTime列转换为Unix Epoch Timestamp

发布于 2025-01-26 22:08:25 字数 413 浏览 1 评论 0原文

我有一个来自CSV存储日期时间的列。我需要能够在该DateTime字段的几秒钟内进行一些简单的计算。我想知道如何使用派生列将DateTime字段转换为Unix Epoch时间戳。

在SQL中,我通常会做这样的事情:

DATEDIFF(second,{d '1970-01-01'},myDateTime)

这给了我整数值。

但是,我在SSIS中尝试过同样的尝试并获得错误,为什么这不能正确解析?

I have a column from a CSV that stores datetime. I need to be able to do some simple calculations on the seconds of that datetime field. I want to know how I can convert the datetime field into the UNIX epoch timestamp using a derived column.

In SQL I would usually just do something like this:

DATEDIFF(second,{d '1970-01-01'},myDateTime)

Which gives me the integer value.

However I've tried the same in SSIS and get errors, why is this not correctly parsing?

enter image description here

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

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

发布评论

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

评论(1

落在眉间の轻吻 2025-02-02 22:08:26

Have you had a look at the SSIS documentation online for

Have you had a look at the SSIS documentation online for datediff? There tends to be usable examples in those docs.

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