The USEC_TO_TIME function converts a number of microseconds to a value of the TIMESTAMP type. OceanBase Database uses UTC (Coordinated Universal Time) as the time zone. Therefore, when you convert a number of microseconds to a TIMESTAMP value, the system considers the time zone information and uses UTC as the time zone.
Function syntax
USEC_TO_TIME(usec)
Parameters
| Parameter | Description |
|---|---|
usec |
The number of microseconds to be converted to a TIMESTAMP value. usec specifies the number of microseconds elapsed since 1970-01-01 00:00:00.000000. |
Examples
obclient> SELECT USEC_TO_TIME(1);
+----------------------------+
| USEC_TO_TIME(1) |
+----------------------------+
| 1970-01-01 08:00:00.000001 |
+----------------------------+
1 row in set
