Extracts the requested date part as an integer value.
Deprecated aliases: datepart()
Learn more about syntax conventions.
|part||string||✓||Measurement of time to extract from date. See possible values.|
|date||datetime||✓||The full date from which to extract part.|
Possible values of part
An integer representing the extracted part.
week_of_year returns an integer which represents the week number. The week number is calculated from the first week of a year, which is the one that includes the first Thursday.
let dt = datetime(2017-10-30 01:02:03.7654321); print year = datetime_part("year", dt), quarter = datetime_part("quarter", dt), month = datetime_part("month", dt), weekOfYear = datetime_part("week_of_year", dt), day = datetime_part("day", dt), dayOfYear = datetime_part("dayOfYear", dt), hour = datetime_part("hour", dt), minute = datetime_part("minute", dt), second = datetime_part("second", dt), millisecond = datetime_part("millisecond", dt), microsecond = datetime_part("microsecond", dt), nanosecond = datetime_part("nanosecond", dt)
weekofyear is an obsolete variant of
weekofyear was not ISO 8601 compliant; the first week of a year was defined as the week with the year's first Wednesday in it.
week_of_year is ISO 8601 compliant; the first week of a year is defined as the week with the year's first Thursday in it. [For more information], see ISO 8601 week dates.