SparkR (version 2.1.2)

year: year

Description

Extracts the year as an integer from a given date/timestamp/string.

Usage

year(x)

# S4 method for Column year(x)

Arguments

x

Column to compute on.

See Also

Other datetime_funcs: add_months, date_add, date_format, date_sub, datediff, dayofmonth, dayofyear, from_unixtime, from_utc_timestamp, hour, last_day, minute, months_between, month, next_day, quarter, second, to_date, to_utc_timestamp, unix_timestamp, weekofyear, window

Examples

Run this code
# NOT RUN {
year(df$c)
# }

Run the code above in your browser using DataCamp Workspace