|
1 | 1 | <!--
|
2 |
| -$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.252 2005/06/07 07:08:34 neilc Exp $ |
| 2 | +$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.253 2005/06/09 16:35:08 momjian Exp $ |
3 | 3 | PostgreSQL documentation
|
4 | 4 | -->
|
5 | 5 |
|
@@ -4082,6 +4082,13 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
|
4082 | 4082 | argument is the value to be formatted and the second argument is a
|
4083 | 4083 | template that defines the output or input format.
|
4084 | 4084 | </para>
|
| 4085 | + <para> |
| 4086 | + The <function>to_timestamp</function> function can also take a single |
| 4087 | + <type>double precision</type> argument to convert from Unix epoch to |
| 4088 | + <type>timestamp with time zone</type>. |
| 4089 | + (<type>Integer</type> Unix epochs are implicitly cast to |
| 4090 | + <type>double precision</type>.) |
| 4091 | + </para> |
4085 | 4092 |
|
4086 | 4093 | <table id="functions-formatting-table">
|
4087 | 4094 | <title>Formatting Functions</title>
|
@@ -4138,6 +4145,12 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
|
4138 | 4145 | <entry>convert string to time stamp</entry>
|
4139 | 4146 | <entry><literal>to_timestamp('05 Dec 2000', 'DD Mon YYYY')</literal></entry>
|
4140 | 4147 | </row>
|
| 4148 | + <row> |
| 4149 | + <entry><literal><function>to_timestamp</function>(<type>double precision</type>)</literal></entry> |
| 4150 | + <entry><type>timestamp with time zone</type></entry> |
| 4151 | + <entry>convert UNIX epoch to time stamp</entry> |
| 4152 | + <entry><literal>to_timestamp(200120400)</literal></entry> |
| 4153 | + </row> |
4141 | 4154 | <row>
|
4142 | 4155 | <entry><literal><function>to_number</function>(<type>text</type>, <type>text</type>)</literal></entry>
|
4143 | 4156 | <entry><type>numeric</type></entry>
|
|
0 commit comments