Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 91bd4ee969
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (20 sloc) 0.693 kb
#' Get Daylight Savings Time indicator of a date-time.
#'
#' Date-time must be a POSIXct, POSIXlt, Date, chron, yearmon, yearqtr, zoo,
#' zooreg, timeDate, xts, its, ti, jul, timeSeries, and fts objects.
#'
#' A date-time's daylight savings flag can not be set because it depends on the
#' date-time's year, month, day, and hour values.
#'
#' @export dst
#' @S3method dst default
#' @param x a date-time object
#' @return A logical. TRUE if DST is in force, FALSE if not, NA if unknown.
#' @keywords utilities chron methods
#' @examples
#' x <- ymd("2012-03-26")
#' dst(x)
dst <- function(x)
UseMethod("dst")
dst.default <- function(x)
c(NA, FALSE, TRUE)[as.POSIXlt(x)$isdst + 2]
Jump to Line
Something went wrong with that request. Please try again.