~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/functions/datetime.rst

  • Committer: lbieber
  • Date: 2010-10-02 19:48:35 UTC
  • mfrom: (1730.6.19 drizzle-make-lcov)
  • Revision ID: lbieber@orisndriz08-20101002194835-q5zd9qc4lvx1xnfo
Merge Hartmut - clean up lex, now require flex to build, also "make lcov" improvements

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_date
8
 
   extract_date
9
 
   date_trunc
10
 
 
11
 
Current
12
 
-------
13
 
 
14
 
+--------------------------+-------------------------------------+-----------------------------------------------------------------+
15
 
|Name                      |Return Type                          |Description                                                      |
16
 
+==========================+=====================================+=================================================================+
17
 
|current_date              |date                                 |Current date                                                     |
18
 
+--------------------------+-------------------------------------+-----------------------------------------------------------------+
19
 
|current_time              |time with time zone                  |Current time of day                                              |
20
 
+--------------------------+-------------------------------------+-----------------------------------------------------------------+
21
 
|current_timestamp         |timestamp with time zone             |Current date and time (start of current transaction)             |
22
 
+--------------------------+-------------------------------------+-----------------------------------------------------------------+
23
 
|localtime                 |time                                 |Current time of day                                              |
24
 
+--------------------------+-------------------------------------+-----------------------------------------------------------------+
25
 
|localtimestamp            |timestamp                            |Current date and time (start of current transaction)             |
26
 
+--------------------------+-------------------------------------+-----------------------------------------------------------------+
27
 
|now()                     |timestamp with time zone             |Current date and time (start of current transaction)             |
28
 
+--------------------------+-------------------------------------+-----------------------------------------------------------------+
29
 
|statement_timestamp()     |timestamp with time zone             |Current date and time (start of current statement)               |
30
 
+--------------------------+-------------------------------------+-----------------------------------------------------------------+
31
 
|timeofday()               |text                                 |Current date and time (as a text string)                         |
32
 
+--------------------------+-------------------------------------+-----------------------------------------------------------------+
33
 
 
34
 
 
35
 
Extract
36
 
-------
37
 
 
38
 
+--------------------------------+-----------------------+---------------------------------------+
39
 
|Name                            |Return Type            |Description                            |
40
 
+================================+=======================+=======================================+
41
 
|extract(field from timestamp)   |double precision       |Get subfield                           |
42
 
+--------------------------------+-----------------------+---------------------------------------+
43
 
|extract(field from interval)    |double precision       |Get subfield                           |
44
 
+--------------------------------+-----------------------+---------------------------------------+
45
 
|date_part(text, timestamp)      |double precision       |Get subfield (equivalent to extract)   |
46
 
+--------------------------------+-----------------------+---------------------------------------+
47
 
|date_part(text, interval)       |double precision       |Get subfield (equivalent to extract)   |
48
 
+--------------------------------+-----------------------+---------------------------------------+
49
 
 
50
 
 
51
 
date_trunc
52
 
----------
53
 
 
54
 
+--------------------------------+-----------------------+---------------------------------------+
55
 
|Name                            |Return Type            |Description                            |
56
 
+================================+=======================+=======================================+
57
 
|date_trunc(text, timestamp)     |timestamp              |Truncate to specified precision        |
58
 
+--------------------------------+-----------------------+---------------------------------------+
59
 
 
60
 
 
61
 
 
62
 
 
63