% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/01_calendar.R
\name{time_calendar}
\alias{time_calendar}
\title{Obtain the calendar of a time object}
\usage{
time_calendar(x, ...)
}
\arguments{
\item{x}{A time object (e.g., \link[base:Date]{base::Date}, \link[base:POSIXct]{base::POSIXct}, \code{\link[=linear_time]{linear_time()}}, etc.)}

\item{...}{Additional arguments for methods.}
}
\value{
A calendar object (e.g., \code{cal_gregorian}, \code{cal_isoweek})
}
\description{
This S7 generic function extracts the calendar system from a time object.
The calendar defines the collection of time units (years, months, days, etc.)
used to interpret the time representation.
}
\examples{

# The calendar of a Date object is the Gregorian calendar
time_calendar(Sys.Date())

# The calendar of a POSIXct object is also Gregorian
time_calendar(Sys.time())

# The calendar of a yearweek object is the ISO week calendar
time_calendar(yearweek(Sys.Date()))

# A mixed time object returns a list of calendars
time_calendar(c(yearmonth(Sys.Date()), Sys.Date()))

}
