Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1014 Bytes

File metadata and controls

40 lines (28 loc) · 1014 Bytes

microseconds_add

功能

expr1 添加指定的时间间隔,单位为微秒。

语法

DATETIME microseconds_add(DATETIME expr1,INT expr2);

参数说明

expr1: 支持的数据类型为 DATETIME。

expr2: 支持的数据类型为 INT,单位为微秒。

返回值说明

返回值的数据类型为 DATETIME。如果输入值为 DATE 类型,则时-分-秒部分默认按照 00:00:00 处理。

示例

select microseconds_add('2010-11-30 23:50:50', 2);
+--------------------------------------------+
| microseconds_add('2010-11-30 23:50:50', 2) |
+--------------------------------------------+
| 2010-11-30 23:50:50.000002                 |
+--------------------------------------------+
1 row in set (0.00 sec)

select microseconds_add('2010-11-30', 2);
+-----------------------------------+
| microseconds_add('2010-11-30', 2) |
+-----------------------------------+
| 2010-11-30 00:00:00.000002        |
+-----------------------------------+