% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/duration.R
\name{duration_helpers}
\alias{duration_helpers}
\alias{years}
\alias{quarters}
\alias{months}
\alias{weeks}
\alias{days}
\alias{hours}
\alias{minutes}
\alias{seconds}
\alias{milliseconds}
\title{Duration helper functions}
\usage{
years(data, calendar = time_calendar(data), ...)

quarters(data, calendar = time_calendar(data), ...)

months(data, calendar = time_calendar(data), ...)

weeks(data, calendar = time_calendar(data), ...)

days(data, calendar = time_calendar(data), ...)

hours(data, calendar = time_calendar(data), ...)

minutes(data, calendar = time_calendar(data), ...)

seconds(data, calendar = time_calendar(data), ...)

milliseconds(data, calendar = time_calendar(data), ...)
}
\arguments{
\item{data}{A time vector of duration magnitudes, or an existing
\code{\link[=duration]{duration()}} vector to convert to \code{chronon} granules.}

\item{calendar}{Calendar system used to evaluate \code{chronon}. Defaults to
\code{time_calendar(data)} for existing time objects. Common options include
\link{cal_gregorian} and \link{cal_isoweek}.}

\item{...}{Additional arguments passed to the chronon (e.g. \code{tz} for
timezones).}
}
\value{
A \code{mixtime} vector containing an \code{mt_duration} vector.
}
\description{
Convenience functions for creating duration vectors of common time units.
Each function wraps \code{\link[=new_duration_fn]{new_duration_fn()}} for its respective chronon.
}
\examples{
years(3L)
quarters(2L)
months(6L)
weeks(4L)
days(7L)
hours(12L)
minutes(30L)
seconds(45L)
milliseconds(500L)

}
\seealso{
\itemize{
\item \code{\link[=new_duration_fn]{new_duration_fn()}} for creating custom duration functions
\item \code{\link[=duration]{duration()}} for creating duration vectors directly
\item \link{cal_gregorian}, \link{cal_isoweek} for calendar systems
}
}
