1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Add 'day' field to INTERVAL so 1 day interval can be distinguished from

24 hours. This is very helpful for daylight savings time:

	select '2005-05-03 00:00:00 EST'::timestamp with time zone + '24 hours';
	      ?column?
	----------------------
	2005-05-04 01:00:00-04

	select '2005-05-03 00:00:00 EST'::timestamp with time zone + '1 day';
	      ?column?
	----------------------
	2005-05-04 01:00:00-04

Michael Glaesemann
This commit is contained in:
Bruce Momjian
2005-07-20 16:42:32 +00:00
parent 826604f9e6
commit db05f4a7eb
12 changed files with 286 additions and 181 deletions

View File

@ -1,5 +1,5 @@
<!--
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.267 2005/07/18 22:34:14 tgl Exp $
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.268 2005/07/20 16:42:29 momjian Exp $
PostgreSQL documentation
-->
@ -5144,6 +5144,22 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
<entry><literal>true</literal></entry>
</row>
<row>
<entry><literal><function>justify_hours</function>(<type>interval</type>)</literal></entry>
<entry><type>interval</type></entry>
<entry>Adjust interval so 24-hour time periods are represented as days</entry>
<entry><literal>justify_hours(interval '24 hours')</literal></entry>
<entry><literal>1 day</literal></entry>
</row>
<row>
<entry><literal><function>justify_days</function>(<type>interval</type>)</literal></entry>
<entry><type>interval</type></entry>
<entry>Adjust interval so 30-day time periods are represented as months</entry>
<entry><literal>justify_days(interval '30 days')</literal></entry>
<entry><literal>1 month</literal></entry>
</row>
<row>
<entry><literal><function>localtime</function></literal></entry>
<entry><type>time</type></entry>