]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/current_timestamp.sgml
1a170efcb021b59c578b47cab4d03515ad9b91aa
[postgresql] / doc / src / sgml / ref / current_timestamp.sgml
1 <REFENTRY ID="SQL-CURRENT-TIMESTAMP-1">
2  <REFMETA>
3   <REFENTRYTITLE>
4    SQL_CURRENT_TIMESTAMP
5   </REFENTRYTITLE>
6   <REFMISCINFO>SQL - Functions</REFMISCINFO>
7  </REFMETA>
8  <REFNAMEDIV>
9   <REFNAME>
10    SQL_CURRENT_TIMESTAMP
11   </REFNAME>
12   <REFPURPOSE>
13    returns the current timestamp, (i.e the
14    date "today" concatenated with time "now").
15   </REFPURPOSE>
16   
17   
18  <REFSYNOPSISDIV>
19   <REFSYNOPSISDIVINFO>
20    <DATE>1998-04-15</DATE>
21   </REFSYNOPSISDIVINFO>
22   <synopsis>
23   CURRENT_TIMESTAMP 
24  </SYNOPSIS>
25   
26   <REFSECT2 ID="R2-SQL-CURRENT-TIMESTAMP-1">
27    <REFSECT2INFO>
28     <DATE>1998-04-15</DATE>
29    </REFSECT2INFO>
30    <TITLE>
31     Inputs
32    </TITLE>
33    <PARA>
34    </PARA>
35    <VARIABLELIST>
36     <VARLISTENTRY>
37      <TERM>
38      </TERM>
39      <LISTITEM>
40       <PARA>
41        <VARIABLELIST>
42         <VARLISTENTRY>
43          <TERM>
44           <ReturnValue>None</ReturnValue>
45          </TERM>
46          <LISTITEM>
47           <PARA>
48           </PARA>
49          </LISTITEM>
50         </VARLISTENTRY>
51        </VARIABLELIST>
52      </LISTITEM>
53     </VARLISTENTRY>
54    </VARIABLELIST>
55   </REFSECT2>
56   
57   <REFSECT2 ID="R2-SQL-CURRENT-TIMESTAMP-2">
58    <REFSECT2INFO>
59     <DATE>1998-04-15</DATE>
60    </REFSECT2INFO>
61    <TITLE>
62     Outputs
63    </TITLE>
64    <PARA>
65    </PARA>
66    <VARIABLELIST>
67     <VARLISTENTRY>
68      <TERM>
69      </TERM>
70      <LISTITEM>
71       <PARA>
72        <VARIABLELIST>
73         <VARLISTENTRY>
74          <TERM>
75           <ReturnValue>Returns "<replaceable class="parameter">today</replaceable>" and "<replaceable class="parameter">now</replaceable>".</ReturnValue>
76          </TERM>
77          <LISTITEM>
78           <PARA>
79           </PARA>
80          </LISTITEM>
81         </VARLISTENTRY>
82        </VARIABLELIST>
83      </LISTITEM>
84     </VARLISTENTRY>
85    </VARIABLELIST>
86   </REFSECT2>
87  </REFSYNOPSISDIV>
88  
89  <REFSECT1 ID="R1-SQL-CURRENT-TIMESTAMP-1">
90   <REFSECT1INFO>
91    <DATE>1998-04-15</DATE>
92   </REFSECT1INFO>
93   <TITLE>
94    Description
95   </TITLE>
96   <PARA>
97    The niladic CURRENT_TIMESTAMP function has a data type of
98    TIMESTAMP and returns the date and local time at which it is run.
99   </PARA>
100   
101   <REFSECT2 ID="R2-SQL-CURRENT-TIMESTAMP-3">
102    <REFSECT2INFO>
103     <DATE>1998-04-15</DATE>
104    </REFSECT2INFO>
105    <TITLE>
106     Notes
107    </TITLE>
108    <PARA>
109     Refer to the SET TIME ZONE statement for a further description
110     of local time.
111    </PARA>
112    
113    
114   </REFSECT2>
115   
116  <REFSECT1 ID="R1-SQL-CURRENT-TIMESTAMP-2">
117   <TITLE>
118    Usage
119   </TITLE>
120   <PARA>
121    Display CURRENT_TIMESTAMP:
122   </PARA>
123   <ProgramListing>
124    SELECT CURRENT_TIMESTAMP AS date_and_time;
125
126    date_and_time
127    ----------------------
128    1998-03-31 07:41:21-08
129   </ProgramListing>
130  </REFSECT1>
131  
132  <REFSECT1 ID="R1-SQL-CURRENT-TIMESTAMP-3">
133   <TITLE>
134    Compatibility
135   </TITLE>
136   <PARA>
137   </PARA>
138   
139   <REFSECT2 ID="R2-SQL-CURRENT-TIMESTAMP-4">
140    <REFSECT2INFO>
141     <DATE>1998-04-15</DATE>
142    </REFSECT2INFO>
143    <TITLE>
144     SQL92
145    </TITLE>
146    <PARA>
147    SQL92 specifies some additional capabilities for CURRENT_TIMESTAMP:
148    </PARA>
149    
150    <VARIABLELIST>
151     <VARLISTENTRY>
152      <TERM>
153      </TERM>
154      <LISTITEM>
155       <PARA>
156        <VARIABLELIST>
157         <VARLISTENTRY>
158          <TERM>
159           <ReturnValue>CURRENT_TIMESTAMP [ (<replaceable class="parameter">scale</replaceable>) ]</ReturnValue>
160          </TERM>
161          <LISTITEM>
162           <PARA>
163            The optional scale for CURRENT_TIMESTAMP, if specified, is an
164            unsigned integer representing the number of digits in the
165            optional seconds fraction of the time value represented
166            by the function.
167           </PARA>
168          </LISTITEM>
169         </VARLISTENTRY>
170        </VARIABLELIST>
171       </para>
172      </LISTITEM>
173     </VARLISTENTRY>
174    </VARIABLELIST>
175   </refsect2>
176  </refsect1>
177 </REFENTRY>
178
179 <!-- Keep this comment at the end of the file
180 Local variables:
181 mode: sgml
182 sgml-omittag:t
183 sgml-shorttag:t
184 sgml-minimize-attributes:nil
185 sgml-always-quote-attributes:t
186 sgml-indent-step:1
187 sgml-indent-data:t
188 sgml-parent-document:nil
189 sgml-default-dtd-file:"../reference.ced"
190 sgml-exposed-tags:nil
191 sgml-local-catalogs:"/usr/lib/sgml/catalog"
192 sgml-local-ecat-files:nil
193 End:
194 -->