~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/functions/datetime.rst

  • Committer: Lee Bieber
  • Date: 2011-03-13 16:37:38 UTC
  • mfrom: (2227.4.18 session2)
  • Revision ID: kalebral@gmail.com-20110313163738-7ti21zk40o2xi3ew
Merge Olaf - Refactor Session

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Date and Time Functions
 
2
=======================
 
3
 
 
4
.. toctree::
 
5
   :hidden: 
 
6
   
 
7
   current_time_functions
 
8
   extract_date_functions
 
9
   date_trunc
 
10
 
 
11
Current
 
12
-------
 
13
 
 
14
For examples of the following, see :doc:`current_time_functions`.
 
15
 
 
16
+-----------------------------------+-------------------------------------+-----------------------------------------------------------------+
 
17
|Name                               |Return Type                          |Description                                                      |
 
18
+===================================+=====================================+=================================================================+
 
19
|current_date                       |date                                 |Current date                                                     |
 
20
+-----------------------------------+-------------------------------------+-----------------------------------------------------------------+
 
21
|current_time                       |time with time zone                  |Current time of day                                              |
 
22
+-----------------------------------+-------------------------------------+-----------------------------------------------------------------+
 
23
|current_timestamp                  |timestamp with time zone             |Current date and time (start of current transaction)             |
 
24
+-----------------------------------+-------------------------------------+-----------------------------------------------------------------+
 
25
|localtime                          |time                                 |Current time of day                                              |
 
26
+-----------------------------------+-------------------------------------+-----------------------------------------------------------------+
 
27
|localtimestamp                     |timestamp                            |Current date and time (start of current transaction)             |
 
28
+-----------------------------------+-------------------------------------+-----------------------------------------------------------------+
 
29
|now()                              |timestamp with time zone             |Current date and time (start of current transaction)             |
 
30
+-----------------------------------+-------------------------------------+-----------------------------------------------------------------+
 
31
|statement_timestamp()              |timestamp with time zone             |Current date and time (start of current statement)               |
 
32
+-----------------------------------+-------------------------------------+-----------------------------------------------------------------+
 
33
 
 
34
 
 
35
Extract
 
36
-------
 
37
 
 
38
For examples of the following, see :doc:`extract_date_functions`.
 
39
 
 
40
+--------------------------------+-----------------------+---------------------------------------+
 
41
|Name                            |Return Type            |Description                            |
 
42
+================================+=======================+=======================================+
 
43
|extract(field from timestamp)   |double precision       |Get subfield                           |
 
44
+--------------------------------+-----------------------+---------------------------------------+
 
45
|extract(field from interval)    |double precision       |Get subfield                           |
 
46
+--------------------------------+-----------------------+---------------------------------------+
 
47
|date_part(text, timestamp)      |double precision       |Get subfield (equivalent to extract)   |
 
48
+--------------------------------+-----------------------+---------------------------------------+
 
49
|date_part(text, interval)       |double precision       |Get subfield (equivalent to extract)   |
 
50
+--------------------------------+-----------------------+---------------------------------------+
 
51
 
 
52
 
 
53
DATE TRUNC
 
54
-----------
 
55
 
 
56
For an example of the following, see :doc:`date_trunc`.
 
57
 
 
58
+--------------------------------+-----------------------+---------------------------------------+
 
59
|Name                            |Return Type            |Description                            |
 
60
+================================+=======================+=======================================+
 
61
|date_trunc(text, timestamp)     |timestamp              |Truncate to specified precision        |
 
62
+--------------------------------+-----------------------+---------------------------------------+
 
63
 
 
64
 
 
65
 
 
66
 
 
67