unix_timestamp {SparkR}R Documentation

unix_timestamp

Description

Gets current Unix timestamp in seconds.

Usage

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

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

## S4 method for signature 'Column,character'
unix_timestamp(x, format = "yyyy-MM-dd HH:mm:ss")

unix_timestamp(x, format)

Arguments

x

a Column of date, in string, date or timestamp type.

format

the target format. See Customizing Formats for available options.

Note

unix_timestamp since 1.5.0

unix_timestamp(Column) since 1.5.0

unix_timestamp(Column, character) since 1.5.0

See Also

Other datetime_funcs: add_months, add_months, add_months,Column,numeric-method; date_add, date_add, date_add,Column,numeric-method; date_format, date_format, date_format,Column,character-method; date_sub, date_sub, date_sub,Column,numeric-method; datediff, datediff, datediff,Column-method; dayofmonth, dayofmonth, dayofmonth,Column-method; dayofyear, dayofyear, dayofyear,Column-method; from_unixtime, from_unixtime, from_unixtime,Column-method; from_utc_timestamp, from_utc_timestamp, from_utc_timestamp,Column,character-method; hour, hour, hour,Column-method; last_day, last_day, last_day,Column-method; minute, minute, minute,Column-method; months_between, months_between, months_between,Column-method; month, month, month,Column-method; next_day, next_day, next_day,Column,character-method; quarter, quarter, quarter,Column-method; second, second, second,Column-method; to_date, to_date, to_date, to_date,Column,character-method, to_date,Column,missing-method; to_timestamp, to_timestamp, to_timestamp, to_timestamp,Column,character-method, to_timestamp,Column,missing-method; to_utc_timestamp, to_utc_timestamp, to_utc_timestamp,Column,character-method; weekofyear, weekofyear, weekofyear,Column-method; window, window, window,Column-method; year, year, year,Column-method

Examples

## Not run: 
##D unix_timestamp()
##D unix_timestamp(df$t)
##D unix_timestamp(df$t, 'yyyy-MM-dd HH')
## End(Not run)

[Package SparkR version 2.2.0 Index]