From 2a34134b6c5a46d8f905a82af51c55a7ec91ecac Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 6 Sep 2001 03:22:42 +0000 Subject: - 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 included Karel Zak --- doc/src/sgml/func.sgml | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 2c2daa11a02..39996e54c39 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ - + Functions and Operators @@ -1564,6 +1564,12 @@ convert timestamp to string to_char(timestamp 'now','HH12:MI:SS') + + to_char(interval, text) + text + convert interval to string + to_char(interval '15h 2m 12s','HH24:MI:SS') + to_char(int, text) text @@ -1645,6 +1651,14 @@ SS second (00-59) + + MS + millisecond (000-999) + + + US + microsecond (000000-999999) + SSSS seconds past midnight (0-86399) @@ -1911,6 +1925,23 @@ to_date('20000Nov31', 'YYYYMonDD'). + + + + Millisecond MS and microcesond US + values are in conversion from string to timestamp used as part of + second after decimal point. For example + to_timestamp('12:3', 'SS:MS') is not 3 milliseconds, + but 300, because the conversion count it as 12 + 0.3. + It means for format 'SS:MS' is '12:3' or '12:30' or '12:300' same + number of miliceconds. For the three milliseconds must be used + '12:003' that the counversion count as + 12 + 0.003 = 12.003 seconds . Here is a more + complex example: + to_timestamp('15:12:02.020.001230','HH:MI:SS.MS.US') + is 15 hours, 12 minutes, 2.021230 seconds. + + -- cgit v1.2.3