to_timestamp {SparkR}R Documentation

to_timestamp

Description

Converts the column into a TimestampType. 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 HH:mm:ss'.

Usage

to_timestamp(x, format)

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

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

Arguments

x

Column to parse.

format

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

Note

to_timestamp(Column) since 2.2.0

to_timestamp(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_date, 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_date, to_utc_timestamp, unix_timestamp, weekofyear, window, year

Examples

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

[Package SparkR version 2.2.2 Index]