decodeTime {oce}R Documentation

Decode a time, similar to as.POSIXct()

Description

Decode a time, similar to as.POSIXct()

Usage

decodeTime(time, timeFormats, tz="UTC")

Arguments

time

a character string with an indication of the time

timeFormats

optional vector of time formats to use, as for as.POSIXct

tz

time zone

Details

Each format in timeFormats is used in turn as the format argument to as.POSIXct, and the first that produces a non-NA result is used. If timeFormats is missing, the following formats are tried, in the stated order:

Value

A time as returned by as.POSIXct.

Author(s)

Dan Kelley

Examples

decodeTime("July 1 2013 01:02:03")
decodeTime("Jul 1 2013 01:02:03")
decodeTime("1 July 2013 01:02:03")
decodeTime("1 Jul 2013 01:02:03")
decodeTime("2013-07-01 01:02:03")
decodeTime("2013/07/01 01:02:03")
decodeTime("2013/07/01")

[Package oce version 0.9-18 Index]