Skip to main content

TO_DAY_OF_YEAR

将日期或带时间的日期(时间戳/日期时间)转换为包含一年中第几天的 UInt16 数字(1-366)。

语法

TO_DAY_OF_YEAR(<expr>)

参数

参数描述
<expr>日期/时间戳

返回类型

SMALLINT

示例

SELECT
to_day_of_year('2023-11-12 09:38:18.165575');

┌──────────────────────────────────────────────┐
│ to_day_of_year('2023-11-12 09:38:18.165575')
├──────────────────────────────────────────────┤
316
└──────────────────────────────────────────────┘
Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today