| as.POSIXct.jul {fame} | R Documentation |
Functions to create objects of classes "POSIXlt" and
"POSIXct" representing calendar dates and times.
## S3 method for class 'jul': as.POSIXct(x, ...) ## S3 method for class 'ti': as.POSIXct(x, ...) as.POSIXlt(x, tz = "", ...) ## Default S3 method: as.POSIXlt(x, tz = "", ...) ## S3 method for class 'Date': as.POSIXlt(x, ...) ## S3 method for class 'jul': as.POSIXlt(x, ...) ## S3 method for class 'ti': as.POSIXlt(x, ...) ## S3 method for class 'POSIXlt': as.POSIXlt(x, tz = "", ...)
x |
An object to be converted. |
tz |
A timezone specification to be used for the conversion,
if one is required. System-specific, but ""
is the current timezone, and "GMT" is UTC
(Coordinated Universal Time, in French). |
... |
other args passed to underlying functions |
The as.POSIX* functions convert an object to one of the two
classes used to represent date/times (calendar dates plus time to the
nearest second). They can take convert a wide variety of objects,
including objects of the other class and of classes "Date",
"date" (from package date or
survival), "chron" and
"dates" (from package chron) to these
classes. Dates are treated as being at midnight UTC.
They can also convert character strings of the formats
"2001-02-03" and "2001/02/03" optionally followed by
white space and a time in the format "14:52" or
"14:52:03". (Formats such as "01/02/03" are ambiguous
but can be converted via a format specification by
strptime.)
Logical NAs can be converted to either of the classes, but no
other logical vectors can be.
asPOSIXlt is generic, while the other functions documented here are
methods for the generic as.POSIX* functions that convert
objects to the POSIXct and POSIXlt classes.
as.POSIXct and as.POSIXlt return objects of the
appropriate class. If tz was specified, as.POSIXlt
will give an appropriate "tzone" attribute.
The standard as.POSIXlt function in package:base is not
generic. That function has been renamed as.POSIZlt.default and
replaced with a generic function calling UseMethod.
Jeff Hallman
as.POSIXct and link{as.POSIXlt} for the generic
functions, and DateTimeClasses for details of the classes.