"POSIXlt"
and
"POSIXct"
representing calendar dates and times.## S3 method for class 'jul':
as.POSIXct(x, \dots)
## S3 method for class 'ti':
as.POSIXct(x, \dots)
as.POSIXlt(x, tz = "", ...)
## S3 method for class 'default':
as.POSIXlt(x, tz = "", \dots)
## S3 method for class 'Date':
as.POSIXlt(x, \dots)
## S3 method for class 'jul':
as.POSIXlt(x, \dots)
## S3 method for class 'ti':
as.POSIXlt(x, \dots)
## S3 method for class 'POSIXlt':
as.POSIXlt(x, tz = "", \dots)
""
is the current timezone, and "GMT"
is UTC
(Coordinated Universal Time, in French).as.POSIXct
and as.POSIXlt
return objects of the
appropriate class. If tz
was specified, as.POSIXlt
will give an appropriate "tzone"
attribute.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 "chron"
and
"dates"
(from package 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 NA
s 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 link{as.POSIXlt}
for the generic
functions, and DateTimeClasses for details of the classes.