Function Reference

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);
make_date
2025-06-05

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;
member_namebirthday_2025
Headley Quincey2025-05-13
Flavia Quincey2025-02-16
Andie Quincey2025-06-05
Lela Quincey2025-06-07
Annie Quincey2025-04-10
Ernest Forrest2025-09-11
Constance Forrest2025-09-06
Wednesday Addams2025-01-13

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.

See also