as.POSIXct.R: string.to.POSIXct

Description Usage Arguments Value See Also Examples

Description

Convers character to POSIXct

Usage

1
string.to.POSIXct(x, format, tz = getOption("date.reader")$tz)

Arguments

x

character; vector to convert to a POSIX date

format

character; name of the format for the values. If this parameter is NA, then the function will try to guess the format for each value

tz

character; optional time zone

Value

POSIXct vector (or NA, if a value cannot be parsed)

See Also

as.POSIXct
strptime for format strings

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
  dts <- c( '20140210', '19791118', '19720329' )
  string.to.POSIXct( dts )

  dts <- rep( '20140210', 10 )
  string.to.POSIXct( dts )

  dts <- c( '14-02-10', '79-11-18' ) # FAIL(?)
  string.to.POSIXct( dts )

  string.to.POSIXct( dts, format='ymd' )

## End(Not run)

decisionpatterns/date.reader documentation built on May 15, 2019, 1:55 a.m.