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

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

date_format(y, x)

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.

See Also

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

Examples

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

[Package SparkR version 1.6.0 Index]