Converts a date/timestamp/string to a value of string in the format specified by the date format given by the second argument.
date_format(y, x)# S4 method for Column,character
date_format(y, x)
Column to compute on.
date format specification.
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.
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_utc_timestamp
,
unix_timestamp
, weekofyear
,
window
, year
# NOT RUN {
date_format(df$t, 'MM/dd/yyy')
# }
Run the code above in your browser using DataLab