month: Extract numeric months of the year from a Date, POSIXct or...

View source: R/datetime_utils.R

monthR Documentation

Extract numeric months of the year from a Date, POSIXct or POSIXlt vector.

Description

Extract numeric months of the year from a Date, POSIXct or POSIXlt vector.

Usage

month(x, string = TRUE, abbreviate = FALSE)

Arguments

x

Date, POSIXct or POSIXlt vector

string

Logical, if TRUE months string is returned, otherwise numeric

abbreviate

logical. Should the months in string format be abbreviated?

Value

A vector with extracted months.

Examples


Sys.Date()
month(Sys.Date())
month(Sys.Date(), string = FALSE)
month(Sys.Date(), string = TRUE, abbreviate = TRUE)
## from base package
month(Sys.Date())
month(as.POSIXct(Sys.Date()))
month(as.POSIXlt(Sys.Date()))



lbraglia/lbmisc documentation built on March 28, 2024, 10:03 a.m.