~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/functions/current_time_functions.rst

  • Committer: Lee Bieber
  • Date: 2011-02-24 03:20:47 UTC
  • mfrom: (2196.1.4 build)
  • Revision ID: kalebral@gmail.com-20110224032047-avmw06iwww3m73cw
Merge Andrew - 723653: Docs day first pass fixes 
Merge Brian - Puts back in support for COM_KILL, Also adds back in the INTERACTIVE flag, and creates a DD to track sessions/check on usage
Merge Olaf - Use List::size()

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
current_date
6
6
-------------
7
7
 
8
 
Returns the current date as a value in 'YYYY-MM-DD' or YYYYMMDD format, depending on whether the function is used in a string or numeric context. ::
 
8
Returns the current date as a value in 'YYYY-MM-DD' or YYYYMMDD format, depending on whether the function is used in a string or numeric context.
 
9
 
 
10
.. code-block:: mysql
9
11
 
10
12
        SELECT CURDATE();
11
13
                -> '2011-02-13'
15
17
current_time
16
18
--------------
17
19
 
18
 
Returns the current time as a value in 'HH:MM:SS' or HHMMSS.uuuuuu format, depending on whether the function is used in a string or numeric context. The value is expressed in the current time zone. ::
 
20
Returns the current time as a value in 'HH:MM:SS' or HHMMSS.uuuuuu format, depending on whether the function is used in a string or numeric context. The value is expressed in the current time zone.
 
21
 
 
22
.. code-block:: mysql
19
23
 
20
24
        SELECT CURTIME();
21
25
                -> '10:30:09'
49
53
now()                               
50
54
------
51
55
 
52
 
NOW returns the current date and time. The return value will be expressed as 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS.uuuuuu, depending on whether the function is used in a string or numeric context. The value is expressed in the current time zone. ::
 
56
NOW returns the current date and time. The return value will be expressed as 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS.uuuuuu, depending on whether the function is used in a string or numeric context. The value is expressed in the current time zone.
 
57
 
 
58
.. code-block:: mysql
53
59
 
54
60
        SELECT NOW();
55
61
                -> '2011-02-15 13:40:06'
66
72
 
67
73
+---------------------+----------+---------------------+
68
74
| NOW()               | SLEEP(2) | NOW()               |
69
 
+---------------------+----------+---------------------+
 
75
+=====================+==========+=====================+
70
76
| 2011-02-20 20:15:09 |        0 | 2011-02-20 20:15:09 |
71
77
+---------------------+----------+---------------------+
72
78
 
80
86
 
81
87
+---------------------+----------+---------------------+
82
88
| SYSDATE()           | SLEEP(2) | SYSDATE()           |
83
 
+---------------------+----------+---------------------+
 
89
+=====================+==========+=====================+
84
90
| 2011-02-20 20:15:09 |        0 | 2011-02-20 20:15:11 |
85
91
+---------------------+----------+---------------------+
86
92
 
87
93
When using replication, the binary log will include SET TIMESTAMP entries so that a database can be restored from the binary log. In doing this, values from NOW will be adjusted to the same times as when the original SQL statements were executed. SYSDATE entries will be unaffected by SET TIMESTAMP entries.
88
94
 
89
 
 
90
 
 
91
 
 
92