File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Original file line number Diff line number Diff line change @@ -9941,6 +9941,20 @@ SELECT date_trunc('hour', INTERVAL '3 days 02:47:33');
9941
9941
aligned with a specified origin.
9942
9942
</para>
9943
9943
9944
+ <para>
9945
+ <synopsis>
9946
+ date_trunc(<replaceable>stride</replaceable>, <replaceable>source</replaceable>, <replaceable>origin</replaceable>)
9947
+ </synopsis>
9948
+ <replaceable>source</replaceable> is a value expression of type
9949
+ <type>timestamp</type> or <type>timestamp with time zone</type>. (Values
9950
+ of type <type>date</type> are cast automatically to
9951
+ <type>timestamp</type>.) <replaceable>stride</replaceable> is a value
9952
+ expression of type <type> interval</type>. The return value is likewise
9953
+ of type <type>timestamp</type> or <type>timestamp with time zone</type>,
9954
+ and it marks the beginning of the bin into which the
9955
+ <replaceable>source</replaceable> is placed.
9956
+ </para>
9957
+
9944
9958
<para>
9945
9959
Examples:
9946
9960
<screen>
@@ -9958,6 +9972,10 @@ SELECT date_bin('15 minutes', TIMESTAMP '2020-02-11 15:44:17', TIMESTAMP '2001-0
9958
9972
that <function>date_bin</function> can truncate to an arbitrary interval.
9959
9973
</para>
9960
9974
9975
+ <para>
9976
+ Negative intervals are allowed and are treated the same as positive intervals.
9977
+ </para>
9978
+
9961
9979
<para>
9962
9980
The <parameter>stride</parameter> interval cannot contain units of month
9963
9981
or larger.
You can’t perform that action at this time.
0 commit comments