date_format {SparkR}R Documentation

date_format

Description

Converts a date/timestamp/string to a value of string in the format specified by the date format given by the second argument.

Usage

date_format(y, x)

## S4 method for signature 'Column,character'
date_format(y, x)

Arguments

y

Column to compute on.

x

date format specification.

Details

A pattern could be for instance

dd.MM.yyyy

and could return a string like '18.03.1993'. All pattern letters of java.text.SimpleDateFormat can be used.

Note: Use when ever possible specialized functions like year. These benefit from a specialized implementation.

Note

date_format since 1.5.0

See Also

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

Examples

## Not run: date_format(df$t, 'MM/dd/yyy')

[Package SparkR version 2.2.1 Index]