Oracle 5.0 Reference Manual page 938

Table of Contents

Advertisement

CONVERT_TZ(dt,from_tz,to_tz)
[918]
CONVERT_TZ()
time zone given by
to_tz
Section 10.6, "MySQL Server Time Zone
invalid.
If the value falls out of the supported range of the
to UTC, no conversion occurs. The
Time Type
Overview".
mysql>
SELECT CONVERT_TZ('2004-01-01 12:00:00','GMT','MET');
-> '2004-01-01 13:00:00'
mysql>
SELECT CONVERT_TZ('2004-01-01 12:00:00','+00:00','+10:00');
-> '2004-01-01 22:00:00'
Note
To use named time zones such as
zone tables must be properly set up. See
Zone
If you intend to use
CONVERT_TZ()
must also lock the
mysql.time_zone_name
[918]
CURDATE()
Returns the current date as a value in
the function is used in a string or numeric context.
mysql>
SELECT CURDATE();
-> '2008-06-13'
mysql>
SELECT CURDATE() + 0;
-> 20080613
[918],
CURRENT_DATE
[918]
CURRENT_DATE
[918],
CURRENT_TIME
[918]
CURRENT_TIME
CURRENT_TIMESTAMP
CURRENT_TIMESTAMP
[926].
NOW()
[918]
CURTIME()
Returns the current time as a value in
whether the function is used in a string or numeric context. The value is expressed in the current time
zone.
mysql>
SELECT CURTIME();
-> '23:50:26'
mysql>
SELECT CURTIME() + 0;
-> 235026.000000
[918]
DATE(expr)
Extracts the date part of the date or datetime expression expr.
mysql>
SELECT DATE('2003-12-31 01:02:03');
-> '2003-12-31'
Date and Time Functions
[918]
converts a datetime value
and returns the resulting value. Time zones are specified as described in
Support". This function returns
TIMESTAMP
Support", for instructions.
[918]
while other tables are locked with
'YYYY-MM-DD'
[918]
CURRENT_DATE()
and
CURRENT_DATE()
[918]
CURRENT_TIME()
and
CURRENT_TIME()
[918],
CURRENT_TIMESTAMP()
[918]
and
CURRENT_TIMESTAMP()
'HH:MM:SS'
918
from the time zone given by
dt
type when converted from
TIMESTAMP
range is described in
or 'Europe/Moscow', the time
'MET'
Section 10.6, "MySQL Server Time
table.
or
YYYYMMDD
[918]
are synonyms for
[918]
are synonyms for
[918]
[918]
are synonyms for
or
HHMMSS.uuuuuu
to the
from_tz
if the arguments are
NULL
from_tz
Section 11.1.2, "Date and
TABLES, you
LOCK
format, depending on whether
[918].
CURDATE()
[918].
CURTIME()
format, depending on

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents