英文:
How does cnosdb convert the current time directly into a timestamp
问题
cnosdb如何将当前时间直接转换为时间戳
我获取时间的方式如下
select now();
+-----------------------------+
| now() |
+-----------------------------+
| 2023-05-15T07:20:55.265027Z |
+-----------------------------+
Query took 0.005 seconds.
但我想直接获取时间戳,应该如何获取?
英文:
How does cnosdb convert the current time directly into a timestamp
I get the time as follows
select now();
+-----------------------------+
| now() |
+-----------------------------+
| 2023-05-15T07:20:55.265027Z |
+-----------------------------+
Query took 0.005 seconds.
But I want to get the timestamp directly.how can i get it?
答案1
得分: 1
Later, I checked some information and found that the data can be changed to timestamp in this way:
public ❯ select cast(now() as bigint);
+---------------------+
| now() |
+---------------------+
| 1684290575284788126 |
+---------------------+
Query took 0.002 seconds.
英文:
Later, I checked some information and found that the data can be changed to timestamp in this way:
public ❯ select cast(now()as bigint);
+---------------------+
| now() |
+---------------------+
| 1684290575284788126 |
+---------------------+
Query took 0.002 seconds.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论