DBeaver:显示日期时间(以毫秒为单位)

时间:2019-08-01 08:06:41

标签: mysql datetime format dbeaver

这是MySQL 5.7列:

`date` datetime(6) NOT NULL

使用控制台我可以看到毫秒:


mysql> select * from teq_log_1;
+----+----------------------------+-------+---------+---------+
| id | date                       | level | message | details |
+----+----------------------------+-------+---------+---------+
|  4 | 2019-08-01 12:23:34.123457 |     2 | test    | NULL    |
+----+----------------------------+-------+---------+---------+

但是我在DBeaver客户端中看不到毫秒:

enter image description here

date列有一个格式选项(右键单击date列/“查看/格式” /“数据格式...”)

enter image description here

DateTimeTimestampNumber类型(无Datetime)。我设置了yyyy-MM-dd HH:mm:ss.sssyyyy-MM-dd HH:mm:ss.mmm模式,但没有结果。

如何在DBeaver(6.1.3版)中显示datetime(6)的毫秒/微秒?

4 个答案:

答案 0 :(得分:7)

打开Use native date/time format对我有用。

答案 1 :(得分:1)

在 Timestamp 下使用 yyyy-MM-dd HH:mm:ss:S:Z(对于 mac ::preferences -> Editors -> Data Editor -> Data Formats)帮助了我。

可以在此处找到有关 dBeaver 文档的更多信息 :: https://dbeaver.com/docs/wiki/Managing-Data-Formats/

答案 2 :(得分:0)

这可能是与缓存有关的问题。我重新创建了表并重新连接DBeaver。现在,我在DBeaver客户端中看到了毫秒: enter image description here

...,我在mysql控制台中看到微秒(但最后3位是“ 0”-插入了unixtime,没有微秒):

mysql> select * from teq_log;
+----+----------------------------+-------+-
| id | date                       | level | 
+----+----------------------------+-------+-
|  5 | 2019-08-01 11:10:27.247000 |     1 | 
|  6 | 2019-08-01 11:10:27.259000 |     1 | 
|  7 | 2019-08-01 11:10:27.636000 |     1 | 
|  8 | 2019-08-01 11:10:27.713000 |     1 | 
|  9 | 2019-08-01 11:10:27.758000 |     1 | 
| 10 | 2019-08-01 11:10:31.768000 |     1 | 
| 11 | 2019-08-01 11:10:32.300000 |     1 | 
+----+----------------------------+-------+-

答案 3 :(得分:0)

使用SSS中的大写yyyy-MM-dd HH:mm:ss.SSS表示毫秒-您使用的是小写的sss

相关问题