Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2a34134

Browse files
committed
- new to_char(interval, text)
- new millisecond (ms) and microsecond (us) support - more robus parsing from string - used is separator checking for non-exact formats like to_date('2001-9-1', 'YYYY-MM-DD') - SGML docs are includedKarel Zak
1 parent74dde13 commit2a34134

File tree

6 files changed

+475
-306
lines changed

6 files changed

+475
-306
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.68 2001/08/31 07:45:09 ishii Exp $ -->
1+
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.69 2001/09/06 03:22:41 momjian Exp $ -->
22

33
<chapter id="functions">
44
<title>Functions and Operators</title>
@@ -1564,6 +1564,12 @@
15641564
<entry>convert timestamp to string</entry>
15651565
<entry>to_char(timestamp 'now','HH12:MI:SS')</entry>
15661566
</row>
1567+
<row>
1568+
<entry>to_char(interval, text)</entry>
1569+
<entry>text</entry>
1570+
<entry>convert interval to string</entry>
1571+
<entry>to_char(interval '15h 2m 12s','HH24:MI:SS')</entry>
1572+
</row>
15671573
<row>
15681574
<entry>to_char(int, text)</entry>
15691575
<entry>text</entry>
@@ -1645,6 +1651,14 @@
16451651
<entry>SS</entry>
16461652
<entry>second (00-59)</entry>
16471653
</row>
1654+
<row>
1655+
<entry>MS</entry>
1656+
<entry>millisecond (000-999)</entry>
1657+
</row>
1658+
<row>
1659+
<entry>US</entry>
1660+
<entry>microsecond (000000-999999)</entry>
1661+
</row>
16481662
<row>
16491663
<entry>SSSS</entry>
16501664
<entry>seconds past midnight (0-86399)</entry>
@@ -1911,6 +1925,23 @@
19111925
<literal>to_date('20000Nov31', 'YYYYMonDD')</literal>.
19121926
</para>
19131927
</listitem>
1928+
1929+
<listitem>
1930+
<para>
1931+
Millisecond <literal>MS</literal> and microcesond <literal>US</literal>
1932+
values are in conversion from string to timestamp used as part of
1933+
second after decimal point. For example
1934+
<literal>to_timestamp('12:3', 'SS:MS')</literal> is not 3 milliseconds,
1935+
but 300, because the conversion count it as <literal>12 + 0.3</literal>.
1936+
It means for format 'SS:MS' is '12:3' or '12:30' or '12:300' same
1937+
number of miliceconds. For the three milliseconds must be used
1938+
'12:003' that the counversion count as
1939+
<literal> 12 + 0.003 = 12.003 seconds </literal>. Here is a more
1940+
complex example:
1941+
<literal>to_timestamp('15:12:02.020.001230','HH:MI:SS.MS.US')</literal>
1942+
is 15 hours, 12 minutes, 2.021230 seconds.
1943+
</para>
1944+
</listitem>
19141945
</itemizedlist>
19151946
</para>
19161947

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp