get_weekdays: Get the days of the week or months of the year

View source: R/datetime.R

get_weekdaysR Documentation

Get the days of the week or months of the year

Description

Get the names of the days of the week in a given locale.

Usage

get_weekdays(abbreviate = FALSE, locale = NULL, from = Sys.Date())

get_months(abbreviate = FALSE, locale = NULL, from = Sys.Date())

Arguments

abbreviate

A logical value indicating whether or not to return abbreviated names (if they are available).

locale

A string denoting the name of the locale to retrieve names in, or NULL to use the current locale.

from

Date to use for the first day/month.

Value

A string containing a regular expression of the names of the days of the week, separated by pipes. The first day of the week will be the current day.

Note

See Sys.setlocale and https://stackoverflow.com/q/20960821/134830 and https://stackoverflow.com/q/26603564/134830 for how to specify the locale.

Examples

get_weekdays()
get_weekdays(TRUE)
get_months()
get_months(TRUE)
## Not run: 
if(.Platform$OS.type == "windows")
{
  get_weekdays(locale = "French_France")
  get_weekdays(TRUE, locale = "French_France")
  get_weekdays(locale = "Arabic_Qatar")
  get_weekdays(TRUE, locale = "Arabic_Qatar")
} else
{
  get_weekdays(locale = "fr_FR.utf8")
  get_weekdays(TRUE, locale = "fr_FR.utf8")
  get_weekdays(locale = "ar_QA.utf8")
  get_weekdays(TRUE, locale = "ar_QA.utf8")
}

## End(Not run)

rebus.datetimes documentation built on Nov. 4, 2022, 1:06 a.m.