LAST_DAY
Syntax
LAST_DAY
(
value IN date
)
RETURNS date;
LAST_DAY
(
value IN TIMESTAMP with time zone
)
RETURNS TIMESTAMP without time zone;Overview
Parameters
Parameter
Description
Example
Last updated
LAST_DAY
(
value IN date
)
RETURNS date;
LAST_DAY
(
value IN TIMESTAMP with time zone
)
RETURNS TIMESTAMP without time zone;Last updated
-- DATE type example: returns the last day of month that '2023-05-15'belongs to
SELECT oracle.LAST_DAY('2023-05-15'::date);
-- result: '2023-05-31' (the last day of May,2023)
last_day
------------
2023-05-31
(1 row)
-- TIMESTAMPTZ type example: return the last day of month that '2023-05-15 14:30:00+09'belongs to
SELECT oracle.LAST_DAY('2023-05-15 14:30:00+09'::timestamptz);
-- result: The timestamp value is returned with the last day of the month combined with the original time information.
last_day
---------------------
2023-05-31 14:30:00
(1 row)