Name
curdatetime, curdatetime_tz — returns current datetime with adjusted fractional part of seconds
Synopsis
curdatetime(
|
in fraction_microseconds integer); |
curdatetime_tz(
|
in fraction_microseconds integer); |
Description
The function returns current datetime, like
now(), but fractional
part of seconds can be adjusted by providing the number of "microseconds"
as the argument.
curdatetime_tz behaves identically to
curdatetime but always returns a timezone-aware
DATETIME stamped with the server's local timezone offset,
even when the session default is timezone-less. Pair it with
forget_timezone
when a naive value is required.
Parameters
fraction_microseconds
Microseconds.
Return Types
A DATETIME timestamp.
Errors
curdatetime does not return errors.
Examples
Example 24.64. Get a timestamp
Get a timestamp in human-readable form.
SQL> select curdatetime();
DATETIME
2015-05-04 09:02:05.242215
No. of rows in result: 1
SQL>select curdatetime(1);
DATETIME
2015-05-04 09:02:47
No. of rows in result: 1