Oracle 5.0 Reference Manual page 949

Table of Contents

Advertisement

+---------------------+----------+---------------------+
| SYSDATE()
+---------------------+----------+---------------------+
| 2006-04-12 13:47:44 |
+---------------------+----------+---------------------+
In addition, the
SET TIMESTAMP
by
[928]. This means that timestamp settings in the binary log have no effect on
SYSDATE()
invocations of
SYSDATE()
Because
SYSDATE()
is not affected by
SET
If that is a problem, you can start the server with the
cause
[928]
SYSDATE()
[928]
also means that indexes cannot be used for evaluating expressions that refer to
SYSDATE()
it.
[929]
TIME(expr)
Extracts the time part of the time or datetime expression
mysql>
SELECT TIME('2003-12-31 01:02:03');
-> '01:02:03'
mysql>
SELECT TIME('2003-12-31 01:02:03.000123');
-> '01:02:03.000123'
TIMEDIFF(expr1,expr2)
[929]
returns
TIMEDIFF()
or date-and-time expressions, but both must be of the same type.
The result returned by
you can use either of the functions
both of which return integers.
mysql>
SELECT TIMEDIFF('2000:01:01 00:00:00',
->
-> '-00:00:00.000001'
mysql>
SELECT TIMEDIFF('2008-12-31 23:59:59.000001',
->
-> '46:58:57.999999'
TIMESTAMP(expr)
With a single argument, this function returns the date or datetime expression
value. With two arguments, it adds the time expression
and returns the result as a datetime value.
expr1
mysql>
SELECT TIMESTAMP('2003-12-31');
-> '2003-12-31 00:00:00'
mysql>
SELECT TIMESTAMP('2003-12-31 12:00:00','12:00:00');
-> '2004-01-01 00:00:00'
TIMESTAMPADD(unit,interval,datetime_expr)
Adds the integer expression
unit for
is given by the
interval
(microseconds), SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or YEAR.
FRAC_SECOND
Beginning with MySQL 5.0.60, it is possible to use
function, and
FRAC_SECOND
The
value may be specified using one of keywords as shown, or with a prefix of SQL_TSI_.
unit
For example,
and
DAY
Date and Time Functions
| SLEEP(2) | SYSDATE()
0 | 2006-04-12 13:47:46 |
statement affects the value returned by
[928].
[928]
can return different values even within the same statement, and
TIMESTAMP, it is nondeterministic and therefore unsafe for replication.
to be an alias for
NOW()
[929]
expressed as a time value.
expr1
expr2
is limited to the range allowed for
TIMEDIFF()
TIMESTAMPDIFF()
'2000:01:01 00:00:00.000001');
'2008-12-30 01:01:01.000002');
[929],
TIMESTAMP(expr1,expr2)
to the date or datetime expression datetime_expr. The
interval
argument, which should be one of the following values:
unit
is deprecated.
FRAC_SECOND
both are legal.
SQL_TSI_DAY
929
|
--sysdate-is-now
[926]. The nondeterministic nature of
and returns it as a string.
expr
expr1
TIME
[930]
and
UNIX_TIMESTAMP()
[929]
to the date or datetime expression
expr2
[929]
in place of
MICROSECOND
is removed in MySQL 5.5.
[926]
but not
NOW()
[423]
option to
and
are time
expr2
values. Alternatively,
[931],
as a datetime
expr
with this
FRAC_SECOND

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents