Learn R Programming

onlineforecast (version 1.0.0)

aslt: Convertion to POSIXlt

Description

The argument is converted into POSIXlt with tz="GMT".

Usage

aslt(object, ...)

# S3 method for character aslt(object, tz = "GMT", ...)

# S3 method for POSIXct aslt(object, tz = NA, ...)

# S3 method for POSIXlt aslt(object, tz = NA, ...)

# S3 method for numeric aslt(object, ...)

Arguments

object

The character, POSIXct, POSIClt, or numeric which is converted to POSIXct.

...

Arguments to be passed to methods.

tz

Timezone. If set, then the time zone will be changed of the object.

Value

An object of class POSIXlt

Methods

#' @examples

# Create a POSIXlt with tz="GMT" aslt("2019-01-01") class(aslt("2019-01-01")) aslt("2019-01-01 01:00:05")

# Convert between time zones x <- aslt("2019-01-01", tz="CET") aslt(x,tz="GMT")

# To seconds and back again aslt(as.numeric(x, units="sec"))

- aslt.character: Simply a wrapper for as.POSIXlt

- aslt.POSIXct: Converts to POSIXct.

- aslt.POSIXlt: Changes the time zone of the object if tz is given.

- aslt.numeric: Converts from UNIX time in seconds to POSIXlt.