to_date {SparkR}R Documentation

to_date

Description

Converts the column into a DateType. You may optionally specify a format according to the rules in: http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html. If the string cannot be parsed according to the specified format (or default), the value of the column will be null. The default format is 'yyyy-MM-dd'.

Usage

to_date(x, format)

## S4 method for signature 'Column,missing'
to_date(x, format)

## S4 method for signature 'Column,character'
to_date(x, format)

Arguments

x

Column to parse.

format

string to use to parse x Column to DateType. (optional)

Note

to_date(Column) since 1.5.0

to_date(Column, character) since 2.2.0

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_timestamp, to_utc_timestamp, unix_timestamp, weekofyear, window, year

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_timestamp, to_utc_timestamp, unix_timestamp, weekofyear, window, year

Examples

## Not run: 
##D to_date(df$c)
##D to_date(df$c, 'yyyy-MM-dd')
## End(Not run)

[Package SparkR version 2.2.2 Index]