Skip to content

Commit 4b1a35b

Browse files
committed
Add example for converting epoch back to timestamp.
1 parent 0fb3ec1 commit 4b1a35b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

doc/src/sgml/func.sgml

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.181 2003/12/13 23:59:06 neilc Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.182 2003/12/16 15:27:58 petere Exp $
33
PostgreSQL documentation
44
-->
55

@@ -5005,6 +5005,15 @@ SELECT EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE '2001-02-16 20:38:40-08');
50055005

50065006
SELECT EXTRACT(EPOCH FROM INTERVAL '5 days 3 hours');
50075007
<lineannotation>Result: </lineannotation><computeroutput>442800</computeroutput>
5008+
</screen>
5009+
5010+
<para>
5011+
Here is how you can convert an epoch value back to a time
5012+
stamp:
5013+
</para>
5014+
5015+
<screen>
5016+
SELECT TIMESTAMP WITH TIME ZONE 'epoch' + 982384720 * interval '1 second';
50085017
</screen>
50095018
</listitem>
50105019
</varlistentry>

0 commit comments

Comments
 (0)