MAKE_DATE
Creates a date from a year, month and day.
PostgreSQL 17.5
MAKE_DATE(year, month, day)Parameters
- yearinteger
- Year, negative for BC
- monthinteger
- Month from 1 to 12
- dayinteger
- Day of the month from 1 to 31
Return value
A date (date); a non-existent date such as 2023-02-29 causes an error
Examples
Date from parts
PostgreSQL 17.5
SELECT MAKE_DATE(2025, 6, 5);Birthday in 2025
PostgreSQL 17.5
SELECT member_name,
MAKE_DATE(
2025,
EXTRACT(
MONTH
FROM birthday
)::int,
EXTRACT(
DAY
FROM birthday
)::int
) AS birthday_2025
FROM FamilyMembers;Details
There is no year 0: MAKE_DATE(0, 1, 1) causes an error, and year -1 is 1 BC. The similar MySQL function MAKEDATE takes other arguments: a year and the day of the year.