decodeTime: Oce Version of as.POSIXct

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Oce Version of as.POSIXct

Usage

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

Arguments

time

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:

  • "%b %d %Y %H:%M:%S" (e.g. "Jul 1 2013 01:02:03")

  • "%b %d %Y" (e.g. "Jul 1 2013")

  • "%B %d %Y %H:%M:%S" (e.g. "July 1 2013 01:02:03")

  • "%B %d %Y" (e.g. "July 1 2013")

  • "%d %b %Y %H:%M:%S" (e.g. "1 Jul 2013 01:02:03")

  • "%d %b %Y" (e.g. "1 Jul 2013")

  • "%d %B %Y %H:%M:%S" (e.g. "1 July 2013 01:02:03")

  • "%d %B %Y" (e.g. "1 July 2013")

  • "%Y-%m-%d %H:%M:%S" (e.g. "2013-07-01 01:02:03")

  • "%Y-%m-%d" (e.g. "2013-07-01")

  • "%Y-%b-%d %H:%M:%S" (e.g. "2013-July-01 01:02:03")

  • "%Y-%b-%d" (e.g. "2013-Jul-01")

  • "%Y-%B-%d %H:%M:%S" (e.g. "2013-July-01 01:02:03")

  • "%Y-%B-%d" (e.g. "2013-July-01")

  • "%d-%b-%Y %H:%M:%S" (e.g. "01-Jul-2013 01:02:03")

  • "%d-%b-%Y" (e.g. "01-Jul-2013")

  • "%d-%B-%Y %H:%M:%S" (e.g. "01-July-2013 01:02:03")

  • "%d-%B-%Y" (e.g. "01-July-2013")

  • "%Y/%b/%d %H:%M:%S" (e.g. "2013/Jul/01 01:02:03")

  • "%Y/%b/%d" (e.g. "2013/Jul/01")

  • "%Y/%B/%d %H:%M:%S" (e.g. "2013/July/01 01:02:03")

  • "%Y/%B/%d" (e.g. "2013/July/01")

  • "%Y/%m/%d %H:%M:%S" (e.g. "2013/07/01 01:02:03")

  • "%Y/%m/%d" (e.g. "2013/07/01")

Value

A time as returned by as.POSIXct.

Author(s)

Dan Kelley

See Also

Other functions relating to time: GMTOffsetFromTz

Examples

1
2
3
4
5
6
7
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")


Search within the oce package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.