跳到主要内容

makedate

makedate

description

Syntax

DATE MAKEDATE(INT year, INT dayofyear)

返回指定年份和dayofyear构建的日期。dayofyear必须大于0,否则结果为空。

example

mysql> select makedate(2021,1), makedate(2021,100), makedate(2021,400);
+-------------------+---------------------+---------------------+
| makedate(2021, 1) | makedate(2021, 100) | makedate(2021, 400) |
+-------------------+---------------------+---------------------+
| 2021-01-01 | 2021-04-10 | 2022-02-04 |
+-------------------+---------------------+---------------------+

keywords

MAKEDATE