]> granicus.if.org Git - postgresql/commitdiff
Add example for converting epoch back to timestamp.
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 16 Dec 2003 15:27:58 +0000 (15:27 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 16 Dec 2003 15:27:58 +0000 (15:27 +0000)
doc/src/sgml/func.sgml

index d73199fb20e5ba2984e79507c837e7a33fe1c776..5724b9b2561442a898f7336637ecb909d3fead15 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.181 2003/12/13 23:59:06 neilc Exp $
+$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.182 2003/12/16 15:27:58 petere Exp $
 PostgreSQL documentation
 -->
 
@@ -5005,6 +5005,15 @@ SELECT EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE '2001-02-16 20:38:40-08');
 
 SELECT EXTRACT(EPOCH FROM INTERVAL '5 days 3 hours');
 <lineannotation>Result: </lineannotation><computeroutput>442800</computeroutput>
+</screen>
+
+       <para>
+        Here is how you can convert an epoch value back to a time
+        stamp:
+       </para>
+
+<screen>
+SELECT TIMESTAMP WITH TIME ZONE 'epoch' + 982384720 * interval '1 second';
 </screen>
       </listitem>
      </varlistentry>