toSAS.datetime {datetime}R Documentation

Convert Timepoint to SAS Format

Description

Convert timepoint objects to SAS format for writing XPT files

Usage

## S3 method for class 'datetime'
toSAS(x, format="", format.info=NULL)
## S3 method for class 'date'
toSAS(x, format="", format.info=NULL)
## S3 method for class 'time'
toSAS(x, format="", format.info=NULL)

Arguments

x

subclass of timepoint

format

SAS format name

format.info

Table of SAS format information

Details

SASxport defines toSAS and calls it on each column when writing XPT files. The datetime method returns the integer number of seconds since the start of 1960-01-01. The date method returns the integer number of days since 1960-01-01.The time method returns the number of seconds since midnight.

Value

numeric

Author(s)

Tim Bergsma

See Also

Examples

if(require(SASxport)) toSAS(as.datetime('1960-01-01T00:00')) # 0
if(require(SASxport)) toSAS(as.date('1960-01-02')) # 1
if(require(SASxport)) toSAS(as.time('00:01')) # 60


[Package datetime version 0.1.4 Index]