MySql数据库中字段类型bigint 长度是10位的
mysql> select (from_unixtime(1554047999))as datatime;
+---------------------+
| datatime |
+---------------------+
| 2019-03-31 23:59:59 |
+---------------------+
1 row in set
mysql> select (unix_timestamp('2019-03-31 23:59:59'))as unixtime;
+------------+
| unixtime |
+------------+
| 1554047999 |
+------------+
1 row in set
如果bigint存储的是13位,因此转换时会有乘以1000及除以1000的操作
mysql> select (from_unixtime(1556609724438/1000))as datatime;
+--------------------------+
| datatime |
+--------------------------+
| 2019-04-30 15:35:24.4380 |
+--------------------------+
具体到表里面查询
mysql> select id,tested from table_A;
+----+------------+
| id | tested |
+----+------------+
| 6 | 1554859010 |
| 7 | 1554859194 |
+----+------------+
mysql> select id,from_unixtime(tested)AS tested from table_A;
+----+---------------------+
| id | tested |
+----+---------------------+
| 6 | 2019-04-10 09:16:50 |
| 7 | 2019-04-10 09:19:54 |
+----+---------------------+
java File 连接局域网文件 java filechannel
Java NIO中的FileChannel是用于连接文件的通道。通过文件通道可以读、写文件的数据。Java NIO的FileChannel是相对标准Java IO API的可选接口。FileChannel不可以设置为非阻塞模式,他只能在阻塞模式下运行。
打开文件通道(Opening a FileChannel)在使用FileChannel前必须打开通道,打开一个文件通道需要通过输入/输出