clickhouse now()带有毫秒

发布于 2025-01-26 10:37:46 字数 233 浏览 2 评论 0原文

我正在尝试在Clickhouse中获取当前的DateTime。有函数now()我可以使用,但是精度仅在几秒钟之内,

select now();
-- result 2022-05-05 10:34:48


select toUnixTimestamp(now());
-- result 1651746940

任何想法我如何才能以毫秒精度获得当前的日期时间?

I'm trying to get a current datetime in the Clickhouse. There is function now() that could I use but the precision is just in seconds

select now();
-- result 2022-05-05 10:34:48


select toUnixTimestamp(now());
-- result 1651746940

Any idea how could I get the current datetime with a milliseconds precision?

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

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

发布评论

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

评论(1

绳情 2025-02-02 10:37:46

尝试now64函数

select now64();

-- 2022-05-05 10:57:32.953

-64函数tounixTimestamp64milli()等。

Try now64 function

select now64();

-- 2022-05-05 10:57:32.953

There are related -64 functions like toUnixTimestamp64Milli() etc.

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